제출 #707831

#제출 시각아이디문제언어결과실행 시간메모리
707831abcvuitunggio저울 (IOI15_scales)C++17
컴파일 에러
0 ms0 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; vector <int> A,B,C; int x= A.push_back(getLightest(1,2,3)); A.push_back(getMedian(1,2,3)); A.push_back(6-A[0]-A[1]); B.push_back(getLightest(4,5,6)); B.push_back(getMedian(4,5,6)); B.push_back(15-B[0]-B[1]); int i=0,j=0; while (i<3&&j<3){ if (i==2&&j==2){ int x=getHeaviest(A[i-1],A[i],B[j]); if (x==A[i]){ C.push_back(B[j]); j++; } else{ C.push_back(A[i]); i++; } continue; } int x=0; if (i<2) x=getLightest(A[i],A[i+1],B[j]); else x=getLightest(A[i],B[j],B[j+1]); C.push_back(x); if (x==A[i]) i++; else j++; } for (int i=0;i<6;i++) W[i]=C[i]; answer(W); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:4:15: warning: unused parameter 'T' [-Wunused-parameter]
    4 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:13:16: error: void value not ignored as it ought to be
   13 |     A.push_back(getLightest(1,2,3));
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
scales.cpp:22:17: warning: declaration of 'x' shadows a previous local [-Wshadow]
   22 |             int x=getHeaviest(A[i-1],A[i],B[j]);
      |                 ^
scales.cpp:12:9: note: shadowed declaration is here
   12 |     int x=
      |         ^
scales.cpp:33:13: warning: declaration of 'x' shadows a previous local [-Wshadow]
   33 |         int x=0;
      |             ^
scales.cpp:12:9: note: shadowed declaration is here
   12 |     int x=
      |         ^
scales.cpp:44:14: warning: declaration of 'i' shadows a previous local [-Wshadow]
   44 |     for (int i=0;i<6;i++)
      |              ^
scales.cpp:19:9: note: shadowed declaration is here
   19 |     int i=0,j=0;
      |         ^
scales.cpp:12:9: warning: unused variable 'x' [-Wunused-variable]
   12 |     int x=
      |         ^