# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
478881 | 2021-10-08T18:46:12 Z | rainboy | Elder (COCI19_elder) | C | 1 ms | 208 KB |
#include <stdio.h> #define A 26 int main() { static char s[2], t[2], visited[A]; int n, a_, a, b, cnt; scanf("%s%d", s, &n); a_ = s[0] - 'A', visited[a_] = 1; while (n--) { scanf("%s%s", s, t), a = s[0] - 'A', b = t[0] - 'A'; if (b == a_) visited[a_ = a] = 1; } cnt = 0; for (a = 0; a < A; a++) if (visited[a]) cnt++; printf("%c\n", a_ + 'A'); printf("%d\n", cnt); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 0 ms | 208 KB | Output is correct |
6 | Correct | 0 ms | 208 KB | Output is correct |
7 | Correct | 1 ms | 208 KB | Output is correct |
8 | Correct | 0 ms | 208 KB | Output is correct |
9 | Correct | 0 ms | 208 KB | Output is correct |
10 | Correct | 1 ms | 208 KB | Output is correct |