# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1049250 | mar | Exam (eJOI20_exam) | C++14 | 70 ms | 3360 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;
typedef long long ll;
const int maxn = 100008;
int main() {
int n; cin>>n;
int ans=0;
vector<int> a, b;
bool flag = true;
int inp;
for(int i=0;i<n;i++) {
cin>>inp;
a.push_back(inp);
if(i>0 && inp <= a[i-1]) flag=false;
}
for(int i=0;i<n;i++){
cin>>inp;
b.push_back(inp);
}
for(int i=0; i<n; i++) {
if(a[i] != inp)continue;
int tmp = i-1;
while(tmp >= 0 && a[tmp] <= inp) {
ans++;
tmp--;
}
while(i < n && a[i] <= inp) {
ans++;
i++;
}
}
cout<<ans<<endl;
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... |