# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86830 | mayhoubsaleh | Preokret (COCI18_preokret) | C++14 | 4 ms | 620 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>
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |