답안 #1027359

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1027359 2024-07-19T04:10:23 Z vjudge1 Ljeto (COCI21_ljeto) C++
0 / 50
0 ms 348 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N, T, A, B, Time, PointA, PointB, Current, PrevTime, CurrentS;
    cin>>N;
    for(int i=0; i<N; i++){
        cin>>T>>A>>B;
        if (A==CurrentS && Current==1 && (T-Time)<=10){
            PointA+=50;
        }
        if (A==CurrentS && Current==2 && (T-Time)<=10){
            PointB+=50;
        }
        if (A==1 || A==2 || A==3 || A==4){
            PointA+=100;
            Current=1;
            CurrentS=A;
        }
        else {
            PointB+=100;
            Current=2;
            CurrentS=A;
        }
        Time=T;
    }
    cout<<PointA<<" "<<PointB;
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:7:52: warning: unused variable 'PrevTime' [-Wunused-variable]
    7 |     int N, T, A, B, Time, PointA, PointB, Current, PrevTime, CurrentS;
      |                                                    ^~~~~~~~
Main.cpp:29:24: warning: 'PointB' may be used uninitialized in this function [-Wmaybe-uninitialized]
   29 |     cout<<PointA<<" "<<PointB;
      |                        ^~~~~~
Main.cpp:29:19: warning: 'PointA' may be used uninitialized in this function [-Wmaybe-uninitialized]
   29 |     cout<<PointA<<" "<<PointB;
      |                   ^~~
Main.cpp:11:9: warning: 'CurrentS' may be used uninitialized in this function [-Wmaybe-uninitialized]
   11 |         if (A==CurrentS && Current==1 && (T-Time)<=10){
      |         ^~
Main.cpp:11:25: warning: 'Current' may be used uninitialized in this function [-Wmaybe-uninitialized]
   11 |         if (A==CurrentS && Current==1 && (T-Time)<=10){
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~
Main.cpp:11:44: warning: 'Time' may be used uninitialized in this function [-Wmaybe-uninitialized]
   11 |         if (A==CurrentS && Current==1 && (T-Time)<=10){
      |                                          ~~^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -