# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
699274 | mmmmaasss | Exam (eJOI20_exam) | C++14 | 121 ms | 3116 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 <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n;cin >> n;
int rr = 0;
vector<int> a(n + 1) , b(n + 1);
for(int i = 1;i <= n;i ++){
cin >> a[i];
}
for(int i = 1;i <= n;i ++){
cin >> b[i];
}
ll ans = 0;
for(int i = 1;i <= n;i ++){
if(a[i] != b[i]){
continue;
}
ll l = i , r = i;
while(r < n && a[r + 1] <= b[i]){
++ r;
}
while(l > 1 && l >= rr && a[l - 1] <= b[i]){
-- l;
}
if(r > rr)ans += r - l + 1;
# | 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... |