# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
478881 | rainboy | Elder (COCI19_elder) | C11 | 1 ms | 208 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |