#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e3+3;
bool check(int x) {
if(x<=4) return 1; else return 0;
}
int main() {
int n;
cin >> n;
int tima=0, timb=0;
int t,a,b;
vector<pair<int,int>>urut;
urut.resize(n);
for(int i=0; i<n; i++) {
cin >> t >> a >> b;
if(check(a)) {
tima+=100;
} else {
timb+=100;
}
urut[i] = {a, t};
}
sort(urut.begin(), urut.end());
for(int i=1; i<n; i++) {
if(urut[i].second - urut[i-1].second <= 10 && urut[i].first == urut[i-1].first) {
if(check(urut[i].first)) {
tima+=50;
} else {
timb+=50;
}
}
}
cout << tima << " " << timb << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
304 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
304 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
296 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
296 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |