-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuri 1367.c
41 lines (33 loc) · 856 Bytes
/
uri 1367.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int n, t, i, s, p;
char c, str[20];
while(scanf("%d", &n) && n)
{
s = 0;
p = 0;
int inc[26]= {0};
int cor[26]= {0};
for (i = 0; i < n; ++i)
{
getchar();
scanf("%c %d %s", &c, &t, &str);
if(strcmp("correct", str) == 0 && cor[(int)c - 65] == 0)
cor[(int)c - 65] = t;
if(strcmp("incorrect", str) == 0 && cor[(int)c - 65] == 0)
inc[(int)c - 65] += 20;
}
for (i = 0; i < 26; ++i)
{
if(cor[i] != 0)
{
s++;
p += (cor[i] + inc[i]);
}
}
printf("%d %d\n", s, p);
}
return 0;
}