Submission #861737

#TimeUsernameProblemLanguageResultExecution timeMemory
861737HossamHero7Ljeto (COCI21_ljeto)C++14
50 / 50
1 ms504 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' void solve(){ int n; cin>>n; vector<array<ll,3>> v(n); for(auto &[t,a,b] : v) cin>>t>>a>>b; vector<int> lst(10,-1e9); ll ans1 = 0; ll ans2 = 0; for(auto [t,a,b] : v){ if(a <= 4) { ans1 += 100; if(t-lst[a] <= 10) ans1 += 50; } else { ans2 += 100; if(t-lst[a] <= 10) ans2 += 50; } lst[a] = t; } cout<<ans1<<' '<<ans2<<endl; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; //cin>>t; while(t--){ solve(); } return 0; }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:9:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    9 |     for(auto &[t,a,b] : v) cin>>t>>a>>b;
      |               ^
Main.cpp:13:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   13 |     for(auto [t,a,b] : v){
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...