#include <bits/stdc++.h>
using namespace std;
struct event{
long long t, a, b;
};
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long n;
cin >> n;
event arr[n + 1];
for (int i = 1; i <= n; i++) cin >> arr[i].t >> arr[i].a >> arr[i].b;
long long teama = 0, teamb = 0, pre = -1e18, num = 0;
for (int i = 1; i <= n; i++)
{
if (arr[i].a <= 4 && arr[i].b >= 5)
{
if (i > 1 && arr[i].t - pre <= 10 && arr[i].a == num) teama += 50;
teama += 100;
}
if (arr[i].a >= 5 && arr[i].b <= 4)
{
if (i > 1 && arr[i].t - pre <= 10 && arr[i].a == num) teamb += 50;
teamb += 100;
}
pre = arr[i].t;
num = arr[i].a;
}
cout << teama << " " << teamb;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |