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;
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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |