Submission #373963

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3739632021-03-06 09:58:34FEDIKUSExam (eJOI20_exam)C++17
12 / 100
88 ms3308 KiB
#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;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...