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>
#define ll long long
#define endl "\n"
#define fastIO cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false);
#define mid ((l + r) / 2)
#define lChild ((index * 2) + 1)
#define rChild ((index * 2) + 2)
using namespace std;
struct node {
ll t, a, b;
};
bool isTeam1(ll a) {
return a <= 4;
}
void solve(ll _) {
ll n; cin>>n;
vector<node> arr(n);
for(int i = 0; i < n; i++) cin>>arr[i].t>>arr[i].a>>arr[i].b;
ll sA = 0, sB = 0;
ll teamStreak = -1;
for(int i = 0; i < n; i++) {
bool lastTime = false;
bool teamA = isTeam1(arr[i].a);
for(int j = i - 1; j >= 0; j--) {
if(arr[i].t - arr[j].t > 10) break;
if(arr[i].a == arr[j].a) {
lastTime = true;
break;
}
}
if(teamA) sA += 100 + (lastTime * 50);
else sB += 100 + (lastTime * 50);
}
cout<<sA<<" "<<sB<<endl;
}
int main() {
fastIO
//freopen("file.in", "r", stdin);
//freopen("file.out", "w", stdout);
ll t = 0; solve(t);
}
Compilation message (stderr)
Main.cpp: In function 'void solve(long long int)':
Main.cpp:31:8: warning: unused variable 'teamStreak' [-Wunused-variable]
31 | ll teamStreak = -1;
| ^~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |