# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
147203 | MatesV13 | Preokret (COCI18_preokret) | C++11 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |