# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
87187 | jvalsortav | Preokret (COCI18_preokret) | C++14 | 4 ms | 544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
#include <set>
using namespace std;
int a, b, x, br, ba, bb, y;
set <int> ak, bk;
int aj = 1, bj = 0;
int main() {
cin >> a;
for (int i = 0; i < a; i++){
cin >> x;
ak.insert(x);
if (x <= 1440) br++;
}
cin >> b;
for (int i = 0; i < b; i++){
cin >> x;
bk.insert(x);
if (x <= 1440) br++;
}
x = *ak.begin();
y = *bk.begin();
if (x > y){
/*ba++;
ak.erase(x);*/
}
else{
/*bb++;
bk.erase(y);*/
aj = 0;
bj = 1;
}
y = 0;
for (int i = 0; i < 2880; i++){
if (ak.count(i)) ba++;
if (bk.count(i)) bb++;
if (aj){
if (ba < bb){
aj = 0;
bj = 1;
y++;
}
}
if (bj){
if (bb < ba){
aj = 1;
bj = 0;
y++;
}
}
}
cout << br << endl << y-1;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |