# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714124 | mongla | Preokret (COCI18_preokret) | C++98 | 0 ms | 0 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>
#define MAX 2880
using namespace std;
int t1[MAX+5],t2[MAX+5];
int main(){
int a,b,x;
cin>>a; for(int i=1;i<=a;i++) cin>>x,t1[x]++;
cin>>b; for(int i=1;i<=b;i++) cin>>x,t2[x]++;
int s1=0,s2=0,exceed=0,ans=0;
char winner='\0';
for(int i=1;i<=MAX;i++){
if(t1[i]) s1++;
if(t2[i]) scoreB++;
ans=s1+scoreB;
if(i==MAX/2) cout<<ans<<'\n';
if(s1>scoreB)
if(winner=='B')
exceed++;
winner='A';
if(s1<scoreB)
if(winner=='A')
exceed++;
winner='B';
}
cout<<exceed;
return 0;
}