Submission #1097388

# Submission time Handle Problem Language Result Execution time Memory
1097388 2024-10-07T07:30:50 Z LilPluton Ljeto (COCI21_ljeto) C++14
25 / 50
1 ms 348 KB
#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;
    vector<array<int,3>> v(n);
    for(int i = 0; i < n; ++i){
        cin >> v[i][0] >> v[i][1] >> v[i][2];
    }
    sort(begin(v), end(v), [&](array<int,3> a, array<int,3> b){
        return a[0] < b[0];
    });
    int team1 = 0, team2 = 0;
    int prev = -1;
    if(v[0][1] <= 4){
        team1 += 100;
    }else{
        team2 += 100;
    }
    prev = v[0][1];
    for(int i = 1; i < n; ++i){
        if(v[i][0] <= v[i - 1][0] + 10){
            if(v[i][1] == prev && prev <= 4){
                team1 += 50;
            }
            if(v[i][1] == prev && prev > 4){
                team2 += 50;
            }
        }
        if(v[i][1] <= 4){
            team1 += 100;
        }else{
            team2 += 100;
        }
        prev = v[i][1];
    }
    cout << team1 << ' ' << team2 << endl;
}

signed main(){
    int T = 1;
    for(int test = 1; test <= T; ++test){
        test_case(test);
    } 
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 Halted 0 ms 0 KB -