Submission #1004635

#TimeUsernameProblemLanguageResultExecution timeMemory
1004635DangerNoodle7591Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms456 KiB
#include <bits/stdc++.h> using namespace std; #define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define endl '\n' #define int long long int //#define ll long long #define pb push_back #define p push #define f first #define s second signed main(){ lalala; int n;cin>>n; int arr[8]; arr[0]=arr[1]=arr[2]=arr[3]=arr[4]=arr[5]=arr[6]=arr[7]=-10000; vector<tuple<int,int,int>> v; for(int i=0;i<n;i++){ int a,b,c;cin>>a>>b>>c; b--;c--; v.pb({a,b,c}); } sort(v.begin(),v.end()); int cev=0,ans=0; for(auto u:v){ int a,b,c;tie(a,b,c)=u; if(b<4){ cev+=100; if(arr[b]+10>=a)cev+=50; } else{ ans+=100; if(arr[b]+10>=a)ans+=50; } arr[b]=a; } cout<<cev<<" "<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...