답안 #499420

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
499420 2021-12-28T11:32:21 Z Rande Ljeto (COCI21_ljeto) C++14
0 / 50
0 ms 204 KB
#include<bits/stdc++.h>
using namespace std;

int main(){
        int n;
        cin>>n;
        long long  c1=0;
        long long c2=0;
        int tt,aa,bb;
        int i,ii;
        int r,rr;
        cin>>tt>>aa>>bb;
        if(aa<=4){
          c1+=100;
          i=tt;
          r=aa;
        }
        else if(aa>=5){
          c2+=100;
          ii=tt;
          rr=aa;
        }
        for(int j=1;j<n;j++){
          int t,a,b;
          cin>>t>>a>>b;
          if(a<=4){
          if(abs(i-t)<=10&&a==r){
            c1+=150;
            i=t;
          }
          else if(a!=r){
            c1+=100;
            i=t;
          }
          r=a;
        }
        else if(a>=5){
           if(abs(ii-t)<=10&&a==rr){
            c2+=150;
            ii=t;
          }
           else if(a!=rr){
            c2+=100;
            ii=t;
            rr=a;
}
}
}
cout<<c1<<" " <<c2<<endl;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:42:17: warning: 'rr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   42 |            else if(a!=rr){
      |                 ^~
Main.cpp:27:26: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |           if(abs(i-t)<=10&&a==r){
      |              ~~~~~~~~~~~~^~~~~~
Main.cpp:38:21: warning: 'ii' may be used uninitialized in this function [-Wmaybe-uninitialized]
   38 |            if(abs(ii-t)<=10&&a==rr){
      |                   ~~^~
Main.cpp:27:19: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |           if(abs(i-t)<=10&&a==r){
      |                  ~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct