#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;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2 ms |
376 KB |
Output is partially correct |
2 |
Partially correct |
2 ms |
488 KB |
Output is partially correct |
3 |
Partially correct |
2 ms |
488 KB |
Output is partially correct |
4 |
Partially correct |
2 ms |
576 KB |
Output is partially correct |
5 |
Partially correct |
2 ms |
576 KB |
Output is partially correct |
6 |
Partially correct |
3 ms |
576 KB |
Output is partially correct |
7 |
Partially correct |
3 ms |
576 KB |
Output is partially correct |
8 |
Partially correct |
3 ms |
576 KB |
Output is partially correct |
9 |
Partially correct |
3 ms |
576 KB |
Output is partially correct |
10 |
Partially correct |
2 ms |
576 KB |
Output is partially correct |