Submission #496489

# Submission time Handle Problem Language Result Execution time Memory
496489 2021-12-21T11:10:36 Z kappa Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

int n, p1, p2, players[8];

struct event{
    int time, from, to, team;
};

event d[105];

int main(){
    memset(players, -11, sizeof(players));

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> d[i].time >> d[i].from >> d[i].to;

        if(d[i].from <= 4){
            d[i].team = 1;
        }else{
            d[i].team = 2;
        }
    }

    for (int i = 0; i < n; i++)
    {
        if(d[i].team == 1){
            p1 += 100;

            if(d[i].time - players[d[i].from - 1] <= 10){
                p1 += 50;
            }
        }
        else{
            p2 += 100;

            if(d[i].time - players[d[i].from - 1] <= 10){
                p2 += 50;
            }
        }

        players[d[i].from - 1] = d[i].time;
    }

    cout << p1 << " " << p2;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct