제출 #1097389

#제출 시각아이디문제언어결과실행 시간메모리
1097389LilPlutonLjeto (COCI21_ljeto)C++14
50 / 50
1 ms348 KiB
#include <bits/stdc++.h>
using namespace std;
const int sz = 5e5 + 5;
#define int long long
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int mod = 1e9 + 7;
struct DSU{
    vector<int>e;
    DSU(int n){
        e.assign(n + 1, -1);
    }
    int _find(int v){
        if(e[v] < 0){
            return v;
        }
        return e[v] = _find(e[v]);
    }
    int _union(int u,int v){
        u = _find(u);
        v = _find(v);
        if(u != v){
            if(e[u] > e[v]){
                swap(u, v);
            }
            e[u] += e[v];
            e[v] = u;
            return 1;
        }
        return 0;
    }
};

void test_case(int testcase){                   
    int n;
    cin >> n;
    map<int,int> so, c;
    for(int i = 0; i < n; ++i){
        int t, a, b;
        cin >> t >> a >> b;
        c[(a + 3) / 4] += 100;
        if(so.find(a) != so.end() && so[a] >= t - 10){
            c[(a + 3) / 4] += 50;
        }
        so[a] = t;
    }
    cout << c[1] << ' ' << c[2] << endl;
}

signed main(){
    int T = 1;
    for(int test = 1; test <= T; ++test){
        test_case(test);
    } 
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...