제출 #1352270

#제출 시각아이디문제언어결과실행 시간메모리
1352270islam_2010Ljeto (COCI21_ljeto)C++20
50 / 50
0 ms344 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    vector<vector<int>> v(10);
    for(int i = 0; i < n; i++){
        int t, x, y;
        cin >> t >> x >> y;
        if(x < 5){
            v[x].push_back(t);
        }else {
            v[x].push_back(t);
        }
    }
    int ans1, ans2;
    ans1 = ans2 = 0;
    for(int i = 1; i <= 8; i++){
        if(i <= 4){
            
            for(int j = 0; j < v[i].size(); j++){
                ans1 += 100;
                if(j != 0 && v[i][j] - v[i][j-1] <= 10){
                    ans1 += 50;
                }
            }
        }else {
            for(int j = 0; j < v[i].size(); j++){
                ans2 += 100;
                if(j != 0 && v[i][j] - v[i][j-1] <= 10){
                    ans2 += 50;
                }
            }
        }
    }
    cout << ans1 << " " << ans2 << endl;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...