제출 #974306

#제출 시각아이디문제언어결과실행 시간메모리
974306vjudge1Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms360 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:6:10: warning: unused variable 'who' [-Wunused-variable]
    6 |     bool who;
      |          ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...