Submission #827871

#TimeUsernameProblemLanguageResultExecution timeMemory
827871ayankarimovaExam (eJOI20_exam)C++14
12 / 100
17 ms3784 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+1], b[n+1]; for(int i=1; i<=n; i++){ cin>>a[i]; } for(int i=1; i<=n; i++){ cin>>b[i]; } bool f=0; 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; } f=0; k=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...