Submission #646927

#TimeUsernameProblemLanguageResultExecution timeMemory
646927GudStonksLjeto (COCI21_ljeto)C++17
50 / 50
1 ms300 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<pair<int, pair<int, int> > >v; for(int i = 1, t, a, b; i <= n; i++) { cin>>t>>a>>b; v.push_back({t, {a, b}}); } int ans = 0, ans1 = 0, ar[9] = {-1, -1, -1, -1, -1, -1, -1, -1, -1}; sort(v.begin(), v.end()); for(int i = 0; i < n; i++) { int t = v[i].first, a = v[i].second.first, b = v[i].second.second; if(a <= 4) ans += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0); else ans1 += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0); ar[a] = t; } cout<<ans<<" "<<ans1; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:17:46: warning: unused variable 'b' [-Wunused-variable]
   17 |   int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
      |                                              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...