# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
373963 | FEDIKUS | Exam (eJOI20_exam) | C++17 | 88 ms | 3308 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>
#define xx first
#define yy second
using namespace std;
typedef pair<int,int> pii;
int main()
{
int n;
cin>>n;
vector<pii> niz(n);
int maxi=0;
int mini=INT_MAX;
for(int i=0;i<n;i++) cin>>niz[i].xx;
for(int i=0;i<n;i++) cin>>niz[i].yy,mini=min(mini,niz[i].yy),maxi=max(maxi,niz[i].yy);
if(mini==maxi){
int ima=false;
int res=0;
int koliko=0;
for(int i=0;i<n;i++){
if(niz[i].yy<niz[i].xx) res+=(ima ? koliko:0),ima=false,koliko=0;
if(niz[i].yy<niz[i].xx) continue;
koliko++;
if(niz[i].yy==niz[i].xx) ima=true;
}
res+=(ima ? koliko:0);
cout<<res;
}
# | 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... |