제출 #134546

#제출 시각아이디문제언어결과실행 시간메모리
134546Boxworld저울 (IOI15_scales)C++14
0 / 100
3 ms632 KiB
#include "scales.h" void init(int T) { /* ... */ } void orderCoins() { int W[6]; int A=getHeaviest(1,2,3); int B=getLightest(1,2,3); int C=6-A-B; int D=getHeaviest(4,5,6); int E=getLightest(4,5,6); int F=15-C-D; int F1=getMedian(A,C,D); int H,I,J,K; if (F1==A){ W[5]=D;K=W[4]=A;J=W[3]=C; }else if (F1==C){ W[5]=A;K=W[4]=C;J=W[3]=D; }else if (F1==D){ W[5]=A;K=W[4]=D;J=W[3]=C; } int G=getMedian(B,E,F);//6 if (G==E){ W[0]=B;H=W[1]=E;I=W[2]=F; }else if (G==B){ W[0]=E;H=W[1]=B;I=W[2]=F; }else if (G==F){ W[0]=E;H=W[1]=F;I=W[2]=B; } int L=getMedian(H,I,J); if (L==H){ int M=getNextLightest(H,I,J,K); if (M==J){ W[1]=J;W[2]=H;W[3]=I;W[4]=K; answer(W); }else if (M==H){ W[1]=J;W[2]=K;W[3]=H;W[4]=I; answer(W); }else if (M==I){ W[1]=J;W[2]=H;W[3]=K;W[4]=I; answer(W); } }else if (L==I){ answer(W); }else if (L==J){ int M=getNextLightest(H,I,J,K); if (M==H){ W[1]=H;W[2]=J;W[3]=I;W[4]=K; answer(W); }else if (M==I){ W[1]=H;W[2]=J;W[3]=K;W[4]=I; answer(W); } } }

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

scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:53:38: warning: 'I' may be used uninitialized in this function [-Wmaybe-uninitialized]
             W[1]=H;W[2]=J;W[3]=K;W[4]=I;
                                  ~~~~^~
scales.cpp:53:17: warning: 'H' may be used uninitialized in this function [-Wmaybe-uninitialized]
             W[1]=H;W[2]=J;W[3]=K;W[4]=I;
             ~~~~^~
scales.cpp:34:38: warning: 'K' may be used uninitialized in this function [-Wmaybe-uninitialized]
         int M=getNextLightest(H,I,J,K);
                                      ^
scales.cpp:48:38: warning: 'J' may be used uninitialized in this function [-Wmaybe-uninitialized]
         int M=getNextLightest(H,I,J,K);
                                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...