# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
813493 | EntityPlantt | Exam (eJOI20_exam) | C++14 | 2 ms | 468 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 <iostream>
using namespace std;
int n, a[10000], b[10000], i, j, v, r;
bool bo;
int main() {
scanf("%d", &n);
for (i = 0; i < n; i++) scanf("%d", a + i);
scanf("%d", b); v = *b;
for (i = 1; i < n; i++) {
scanf("%d", b + i);
if (v != b[i]) v = 0;
}
if (v) {
for (i = 0, j = -1; i < n; i++) {
if (a[i] > v) {
if (bo) r += i - j - 1;
bo = false; j = i;
}
else if (a[i] == v) bo = true;
}
if (bo) r += n - j - 1;
printf("%d", r);
return 0;
}
if (n > 5000) {
// Segment tree
return 0;
}
// DP
return 0;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |