# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147203 | MatesV13 | Preokret (COCI18_preokret) | C++11 | 2 ms | 376 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 a[2881],b[2881],A, B, x, reza, rezb, vod, ok;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>A; for(int i=1;i<A+1;i++) {cin>>x;a[x]++;}
cin>>B; for(int j=1;j<B+1;j++) {cin>>x;b[x]++;}
x=0; for (int i=0;i<1441;i++){if(a[i])x++; if(b[i])x++;}
for(int i=1;i<2881;i++){
if(a[i])reza++; if(b[i])rezb++;
if (reza+rezb==1){if(reza) vod=1; else vod=2;}
if (reza>rezb and vod==2){vod=1; ok++;}
if (reza<rezb and vod==1){vod=2; ok++;}
}
cout << x << endl << ok;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |