#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define pii pair<int,int>
#define int long long
#define nah_id_win ios_base::sync_with_stdio(0); cin.tie(0)
signed main(){
nah_id_win;
int n; cin >> n;
vector<pair<int, pair<int, int>>> a(n); //{time, {a, b}}
for (int i = 0; i < n; i++){
cin >> a[i].fi >> a[i].se.fi >> a[i].se.se;
}
sort(all(a));
int elang = 0, bebek = 0;
for (int i = 0; i < n; i++){
int t = a[i].fi;
int lempar = a[i].se.fi, kena = a[i].se.se;
if (lempar <= 4) elang += 100;
else if (lempar >= 5) bebek += 100;
if (i >= 1){
if (lempar == a[i-1].se.fi && t <= a[i-1].fi + 10){
//cout << "wlee\n";
if (lempar <= 4) elang += 50;
else if (lempar >= 5) bebek += 50;
}
}
}
cout << elang << " " << bebek << "\n";
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:26:28: warning: unused variable 'kena' [-Wunused-variable]
26 | int lempar = a[i].se.fi, kena = a[i].se.se;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 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 |
1 ms |
344 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 |
- |