#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define pii pair<int, int>
int n;
vector<pii> v[10];
signed main() {
ios_base::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
int a, b, t;
cin >> t >> a >> b;
v[a].pb({t, b});
}
int res1 = 0;
for (int i = 1; i <= 4; i++) {
sort(v[i].begin(), v[i].end());
for (int j = 0; j < v[i].size(); j++) {
res1 += 100;
if (j > 0 && v[i][j].F - 10 <= v[i][j - 1].F) res1 += 50;
}
}
int res2 = 0;
for (int i = 5; i <= 8; i++) {
sort(v[i].begin(), v[i].end());
for (int j = 0; j < v[i].size(); j++) {
res2 += 100;
if (j > 0 && v[i][j].F - 10 <= v[i][j - 1].F) res2 += 50;
}
}
cout << res1 << ' ' << res2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |