Submission #86830

#TimeUsernameProblemLanguageResultExecution timeMemory
86830mayhoubsalehPreokret (COCI18_preokret)C++14
50 / 50
4 ms620 KiB
#include <bits/stdc++.h> using namespace std; int n,m,a[3000],b[3000],x; int now=3000; void read(){ cin>>n; cin>>x; now=min(now,x); a[x]++; for(int i=1;i<n;i++){ cin>>x; a[x]++; } cin>>m; cin>>x; now=min(now,x); b[x]++; for(int i=1;i<m;i++){ cin>>x; b[x]++; } } int ans; int main(){ read(); for(int i=1;i<=2880;i++){ a[i]+=a[i-1]; b[i]+=b[i-1]; } cout<<a[24*60]+b[24*60]<<endl; int i; while(now<=2880){ if(a[now]>b[now]){ for(i=now+1;i<=2880;i++){ if(b[i]>a[i]){ans++;break;} } } else { for(i=now+1;i<=2880;i++){ if(a[i]>b[i]){ans++;break;} } } now=i; } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...