# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823873 | 2023-08-13T09:14:16 Z | rainboy | Flip it and Stick it (CCO23_day2problem1) | C | 1 ms | 468 KB |
#include <stdio.h> #include <string.h> #define N 200000 int main() { static char aa[N + 1], bb[4]; int n, m, k, i; scanf("%s%s", aa, bb), n = strlen(aa), m = strlen(bb); if (m == 1) { for (i = 0; i < n; i++) if (aa[i] == bb[0]) { printf("-1\n"); return 0; } printf("0\n"); } else if (m == 2) { if (bb[0] != bb[1]) { k = 0; for (i = -1; i < n; i++) if ((i < 0 ? bb[1] : 0) != (i + 1 == n ? bb[0] : 0)) k++; printf("%d\n", k / 2); } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 468 KB | Output is correct |
4 | Correct | 1 ms | 468 KB | Output is correct |
5 | Correct | 1 ms | 428 KB | Output is correct |
6 | Correct | 1 ms | 468 KB | Output is correct |
7 | Correct | 1 ms | 468 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |