This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*#pragma GCC optimize("O3")
#pragma GCC target ("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")*/
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 107;
int n, sx, sy;
vector<int> a[9];
signed main () {
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n;
for (int t, x, y, i = 1; i <= n; i++) {
cin >> t >> x >> y;
a[x].push_back(t);
}
for (int i = 1; i <= 8; i++) {
sort(a[i].begin(), a[i].end());
}
for (int i = 1; i <= 4; i++) {
sx += (int)a[i].size() * 100;
for (int j = 1; j < (int)a[i].size(); j++) {
if (abs(a[i][j] - a[i][j-1]) <= 10) {
sx += 50;
}
}
}
cout << sx << ' ';
for (int i = 5; i <= 8; i++) {
sy += (int)a[i].size() * 100;
for (int j = 1; j < (int)a[i].size(); j++) {
if (abs(a[i][j] - a[i][j-1]) <= 10) {
sy += 50;
}
}
}
cout << sy;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |