Submission #494188

#TimeUsernameProblemLanguageResultExecution timeMemory
494188ktkeremLjeto (COCI21_ljeto)C++17
50 / 50
1 ms308 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; ll _i=0; #define ffn(x) _i=x #define llll pair<ll , ll> #define stitr set<llll>::iterator #define fora(y,x) for(ll y=_i;x>y;y++) #define pb push_back #define pf push_front #define debu cout << "hello\n" #define fi first #define sec second #define all(a) a.begin() , a.end() const ll limit = 1e13 + 7; const ll ous=1e6 + 5; const ll dx[4] = {1 , -1 , 0 , 0} , dy[4] = {0,0,-1,1}; void solve(){ ll n;cin >> n; vector<pair<ll , llll>> v; fora(i,n){ ll x ,y , z;cin >>x >> y >> z; v.pb({x, {y,z}}); } sort(all(v)); ll ta=0 , tb=0; vector<ll> play(10 , -limit); for(ll i = 0 ;n>i;i++){ ll y = v[i].fi - play[v[i].sec.fi]; if(y <= 10){ if(v[i].sec.fi <= 4){ ta += 150; } else{ tb +=150; } play[v[i].sec.fi] = v[i].fi; } else{ if(v[i].sec.fi <= 4){ ta += 100; } else{ tb +=100; } play[v[i].sec.fi] = v[i].fi; } } cout << ta << " " << tb << "\n"; return; } signed main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); ll t=1; //cin >> t; while(t--){ solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...