#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mmod = 998244353;
#define vl vector<long long>
#define vll vector<vector<long long>>
#define pl pair<long long, long long>
#define vb vector<bool>
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vll s (8);
for (ll i = 0; i < n; i++){
ll t,a ,b;
cin >> t >> a >> b;
a--;
s[a].push_back(t);
}
ll s1 = 0, s2 = 0;
for (ll i = 0; i < 8; i++){
sort(s[i].begin(), s[i].end());
ll u = 0;
for (ll j = 0; j < s[i].size(); j++){
ll prvek = s[i][j];
while (prvek - 10 > s[i][u]){
u++;
}
if (i < 4){
s1 += 100 + 50*(j-u);
}
else{
s2 += 100 + 50*(j-u);
}
}
}
cout << s1 << " " << s2 <<"\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |