This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Ye Rooz Khoob Miad ???
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int Inf = 1061109567;
struct Data {
int t, a, b;
};
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
vector<Data> game;
for(int i = 0; i < n; i++) {
int t, a, b;
cin >> t >> a >> b;
game.pb({t, a, b});
}
ll teamA = 0, teamB = 0;
vector<int> last(10, -Inf);
for(auto [t, a, b] : game) {
int bones = 0;
if(t - last[a] <= 10) bones = 50;
if(a <= 4) teamA += 100 + bones;
else teamB += 100 + bones;
last[a] = t;
}
cout << teamA << ' ' << teamB << '\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... |