# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87187 | jvalsortav | Preokret (COCI18_preokret) | C++14 | 4 ms | 544 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 <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... |