# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745319 | 2023-05-19T20:55:26 Z | rainboy | Exam (eJOI20_exam) | C | 28 ms | 3072 KB |
#include <stdio.h> #define N 100000 int max(int a, int b) { return a > b ? a : b; } int main() { static int aa[N], bb[N]; int n, same, i, j, b, k, good; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &aa[i]); for (i = 0; i < n; i++) scanf("%d", &bb[i]); same = 1; for (i = 1; i < n; i++) if (bb[i] != bb[i - 1]) { same = 0; break; } if (same) { b = bb[0], k = 0; for (i = 0; i < n; i++) if (aa[i] <= b) { j = i; good = 0; while (j < n && aa[j] <= b) if (aa[j++] == b) good = 1; if (good) k += j - i; i = j; } printf("%d\n", k); } return 0; }
Compilation message
# | 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 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 6 ms | 340 KB | Output is correct |
3 | Correct | 20 ms | 1960 KB | Output is correct |
4 | Correct | 16 ms | 1452 KB | Output is correct |
5 | Correct | 27 ms | 3072 KB | Output is correct |
6 | Correct | 17 ms | 1384 KB | Output is correct |
7 | Correct | 18 ms | 1608 KB | Output is correct |
8 | Correct | 28 ms | 2872 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 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 | - |