Submission #485265

#TimeUsernameProblemLanguageResultExecution timeMemory
485265rainboyGTA (COI14_gta)C11
10 / 100
58 ms5172 KiB
#include <stdio.h> #include <string.h> #define N 100 #define L 50000 int main() { static int aa[N], gg[N]; static char ans[N][N + 1]; int n, i, j; scanf("%d", &n); for (i = 0; i < n; i++) { static char s[L + 1]; int l, h, r; scanf("%s", s), l = strlen(s); for (h = 0, r = 1; h < l; h++) if (s[h] == 'A') aa[i] ^= r, r = r % 3 + 1; else if (s[h] == 'G') gg[i] ^= r, r = r % 3 + 1; else if (s[h] == 'C') aa[i] ^= r, r = r % 3 + 1, gg[i] ^= r, r = r % 3 + 1; else gg[i] ^= r, r = r % 3 + 1, aa[i] ^= r, r = r % 3 + 1; } for (i = 0; i < n; i++) for (j = 0; j < n; j++) ans[i][j] = aa[i] == aa[j] && gg[i] == gg[j] ? '1' : '0'; for (i = 0; i < n; i++) printf("%s\n", ans[i]); return 0; }

Compilation message (stderr)

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