답안 #974306

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
      |          ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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