Submission #974306

# Submission time Handle Problem Language Result Execution time Memory
974306 2024-05-03T07:56:25 Z vjudge1 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 360 KB
#include <bits/stdc++.h>
using namespace std;
pair<bool, int> players[9];

int main(){
    bool who;
    int n, poin1 = 0, poin2 = 0;
    cin >> n;
    for(int i = 1; i <= n;i++){
        int detik, w, l;
        cin >> detik >> w >> l;
        if(w <= 4){
            if(players[w].first && players[w].second >= detik){
                poin1 += 150;
                players[w].second = detik + 10;
            }
            else{
                poin1 += 100;
                players[w].first = true;
                players[w].second = detik + 10;
            }
        }
        else{
            if(players[w].first && players[w].second >= detik){
                poin2 += 150;
                players[w].second = detik + 10;
            }
            else{
                poin2 += 100;
                players[w].first = true;
                players[w].second = detik + 10;
            }
        }
    }
    cout << poin1 << " " << poin2;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:6:10: warning: unused variable 'who' [-Wunused-variable]
    6 |     bool who;
      |          ^~~
# 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 1 ms 348 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 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 360 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct