Submission #478881

#TimeUsernameProblemLanguageResultExecution timeMemory
478881rainboyElder (COCI19_elder)C11
50 / 50
1 ms208 KiB
#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)

elder.c: In function 'main':
elder.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%s%d", s, &n);
      |  ^~~~~~~~~~~~~~~~~~~~
elder.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%s%s", s, t), a = s[0] - 'A', b = t[0] - 'A';
      |   ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...