# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382849 | 2021-03-28T10:23:07 Z | aris12345678 | Exam (eJOI20_exam) | C++14 | 32 ms | 3180 KB |
#include <bits/stdc++.h> using namespace std; const int mxN = 1e6+5; int a[mxN], b[mxN]; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); for(int i = 0; i < n; i++) scanf("%d", &b[i]); int i = 0, j = 0, mx = 0, ans = 0; while(j < n) { if(a[j] > b[0] && mx == b[0]) ans += (j-i), mx = 0; while(a[j] > b[0]) j++, i = j; mx = max(mx, a[j++]); } if(mx == b[0]) ans += (j-i); printf("%d\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 492 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 7 ms | 876 KB | Output is correct |
3 | Correct | 23 ms | 2156 KB | Output is correct |
4 | Correct | 21 ms | 1516 KB | Output is correct |
5 | Correct | 32 ms | 3180 KB | Output is correct |
6 | Correct | 23 ms | 1516 KB | Output is correct |
7 | Correct | 22 ms | 1644 KB | Output is correct |
8 | Correct | 32 ms | 3052 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 492 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 492 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |