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"
using namespace std;
#define int long long
struct spray { int time, player1, onplayer2; };
const int MAXN = 101;
spray sprays[MAXN];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> sprays[i].time >> sprays[i].player1 >> sprays[i].onplayer2;
vector<vector<int>> count1(1001, vector<int>(101)), count2(1001, vector<int>(101));
int team1 = 0, team2 = 0;
for (int i = 1; i <= n; i++) {
spray x = sprays[i];
bool first_to_second = 1 <= x.player1 && x.player1 <= 4 && 5 <= x.onplayer2 && x.onplayer2 <= 8;
if (first_to_second) team1 += 100;
else team2 += 100;
count1[x.time][x.player1] |= first_to_second, count2[x.time][x.player1] |= !first_to_second;
for (int j = 1; j <= 10; j++) {
if (x.time - j < 0) break;
if (count1[x.time - j][x.player1] && first_to_second) {
team1 += 50;
break;
}
if (count2[x.time - j][x.player1] && !first_to_second) {
team2 += 50;
break;
}
}
}
cout << team1 << ' ' << team2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |