답안 #494188

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
494188 2021-12-14T16:53:16 Z ktkerem Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 308 KB
#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; 
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 308 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct