Submission #827868

#TimeUsernameProblemLanguageResultExecution timeMemory
827868ayankarimovaExam (eJOI20_exam)C++14
0 / 100
1 ms468 KiB
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long const ll sz=100005; int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); ll n; cin>>n; ll a[n], b[n]; for(int i=1; i<=n; i++){ cin>>a[i]; } for(int i=1; i<=n; i++){ cin>>b[i]; } bool f=1; ll ans=0, k=0; for(int i=1; i<=n; i++){ if(a[i]==b[i]){ f=1; } if(a[i]<=b[i]){ k++; } if(a[i]>b[i] || i==n){ if(f==1){ ans+=k; k=0; } f=0; } } cout<<ans; }
#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...