This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |