比赛 |
20110928 |
评测结果 |
WWWWWWWWWW |
题目名称 |
拱猪计分 |
最终得分 |
0 |
用户昵称 |
王者自由 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2011-09-28 20:20:51 |
显示代码纯文本
#include <cstdio>
const int S[14] = {0, -50, -2, -3, -4, -5, -6, -7, -8, -9, -10, -20, -30, -40};
int score[4], n, now;
bool pig, sheep, times;
char c;
int main() {
freopen("heart.in","r",stdin);
freopen("heart.out","w",stdout);
for(int i=0; i<4; i++) {
score[i] = 0;
pig = sheep = times = false;
scanf("%d", &n);
for(int j=0; j<n; j++) {
do scanf("%c", &c); while(c == ' ');
scanf("%d", &now);
if(c == 'S' && now == 12) pig = true;
if(c == 'D' && now == 11) sheep = true;
if(c == 'C' && now == 10) times = true;
if(c == 'H') score[i] += S[now];
}
scanf("\n");
if(n == 1 && times)
score[i] = 50;
else if(score[i] != -194) {
if(pig) score[i] -= 100;
if(sheep) score[i] += 100;
if(times) score[i] *= 2;
} else {
score[i] = 200;
if(pig && sheep) score[i] = 500;
else {
if(pig) score[i] -= 100;
if(sheep) score[i] += 100;
}
if(times) score[i] *= 2;
}
}
for(int i=0; i<4; i++)
printf("%c%d ", score[i]>0 ? '+' : '\0', score[i]);
return 0;
}