Submission #1332021

#TimeUsernameProblemLanguageResultExecution timeMemory
1332021kawhietLjeto (COCI21_ljeto)C++20
50 / 50
1 ms344 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<array<int, 3>> x(n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> x[i][j];
        }
    }
    ranges::sort(x);
    vector<int> when(9, -20);
    int ans1 = 0, ans2 = 0;
    for (int i = 0; i < n; i++) {
        auto [t, a, b] = x[i];
        int res = 100;
        if (when[a] >= t - 10) {
            res += 50;
        }
        if (a <= 4) {
            ans1 += res;
        } else {
            ans2 += res;
        }
        when[a] = t;
    }
    cout << ans1 << ' ' << ans2 << '\n';
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...