Submission #866732

#TimeUsernameProblemLanguageResultExecution timeMemory
866732becaidoLjeto (COCI21_ljeto)C++17
50 / 50
1 ms348 KiB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define Waimai ios::sync_with_stdio(false), cin.tie(0)
#define FOR(x,a,b) for(int x = a, I = b; x <= I; x++)
#define pb emplace_back
#define F first
#define S second

int n;
int ans[2];
vector<int> v[10];

int main() {
    Waimai;
    cin >> n;
    while (n--) {
        int t, a, b;
        cin >> t >> a >> b;
        v[a].pb(t);
    }
    FOR (i, 1, 8) {
        int sum = 0;
        sort(v[i].begin(), v[i].end());
        FOR (j, 0, (int) v[i].size() - 1) {
            if (j == 0 || v[i][j] - v[i][j - 1] > 10) sum += 100;
            else sum += 150;
        }
        ans[(i - 1) / 4] += sum;
    }
    cout << ans[0] << ' ' << ans[1] << '\n';
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...