Submission #875574

#TimeUsernameProblemLanguageResultExecution timeMemory
875574ifateenLjeto (COCI21_ljeto)C++14
50 / 50
1 ms1884 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...