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 <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 (stderr)
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;
| ^~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |