#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
# define ll long long
# define QR ios_base::sync_with_stdio(false); cin.tie(); cout.tie()
# define endl '\n'
# define rall(x) x.rbegin(), x.rend()
# define all(x) x.begin(), x.end()
# define ff first
# define ss second
const int maxn = (int)(1e6 + 7);
const int TAM = 200000 + 7; // 2e5
const int sz = 1000;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const long long INFL = 1e18 + 7;
void solve() {
    ll n ;
    cin >> n ;                              /////////      komandada 4 adaam var
    vector < pair < ll , pair < ll , ll > > > v(n) ;
    ll t1 = 0 , t2 = 0 ;
    for(ll i = 0 ; i < n ; i++){
        cin >> v[i].ff >> v[i].ss.ff >> v[i].ss.ss ;
    }
    map < ll , ll > cur ;
    sort(all(v)) ;
    for(ll i = 1 ; i <= 8 ; i++)
        cur[i] = -INF ;
    for(ll i = 0 ; i < n ; i++){
        ll t = v[i].ff;
        ll a = v[i].ss.ff;
        ll b = v[i].ss.ss;
        if(a <= 4){
            t1 += 100;
        }
        else{
            t2 += 100;
        }
        if(cur[a] == -1){
            cur[a] = t;
            continue;
        }
        else{
            if(t - cur[a] <= 10){
                if(a <= 4){
                    t1 += 50;
                }
                else{
                    t2 += 50;
                }
            }
            cur[a] = t;
        }
    }
    cout << t1 << " " << t2 << endl ;
}
signed main() {
    QR;
    ll tt = 1;
    // cin >> tt ;
    while (tt--)
        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... |