# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485265 | rainboy | GTA (COI14_gta) | C11 | 58 ms | 5172 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>
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |