이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |