Submission #866817

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