제출 #125694

#제출 시각아이디문제언어결과실행 시간메모리
125694SOIVIEONE저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include "scales.h" #include "graderlib.c" void init(int T) { } int x[5], y[5], w[6]; void orderCoins() { x[3] = getHeaviest(1, 2, 3); y[3] = getHeaviest(4, 5, 6); x[2] = getMedian(1, 2, 3); y[2] = getMedian(4, 5, 6); for(int i = 1; i <= 3; i ++) if(i != x[3] && i != x[2]) x[1] = i; for(int i = 4; i <= 6; i ++) if(i != y[3] && i != y[2]) y[1] = i; int a1 = getLightest(x[1], y[1], y[2]); int l = 1, r = 1; if(a1 == x[1]) w[0] = x[1], l ++; else w[0] = y[1], r ++; a1 = getLightest(x[l], y[r], y[3]); if(a1 == x[l]) w[1] = x[l], l ++; else w[1] = y[r], r ++; a1 = getLightest(x[l], y[r], (r == 3 ? x[3] : y[3])); if(a1 == x[l]) { l ++; } else { r ++; } w[2] = a1; a1 = getLightest(x[l], y[r], (r == 3 ? x[3] : y[3])); w[3] = a1; if(a1 == x[l]) l ++; else r ++; if(l > 3) a1 = getMedian(w[0], y[2], y[3]); else if(r > 3) a1 = getMedian(w[0], x[2], x[3]); else a1= getMedian(w[0], x[3], y[3]); w[4] = a1; for(int i = 1; i <= 6; i ++) { int flag = 0; for(int j = 0; j <= 4; j ++) if(w[j] == i) { flag = 1; break; } if(!flag) { w[5] = i; break; } } answer(w); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
In file included from scales.cpp:2:0:
graderlib.c: At global scope:
graderlib.c:35:13: warning: 'void _gsadfghjjsadhfjnk1jrn()' defined but not used [-Wunused-function]
 static void _gsadfghjjsadhfjnk1jrn() {    
             ^~~~~~~~~~~~~~~~~~~~~~
graderlib.c:18:12: warning: 'int _gkjhskglhjaskndnas()' defined but not used [-Wunused-function]
 static int _gkjhskglhjaskndnas() {
            ^~~~~~~~~~~~~~~~~~~
/tmp/ccQA9Cdv.o: In function `answer':
scales.cpp:(.text+0xe0): multiple definition of `answer'
/tmp/ccobJhw2.o:grader.c:(.text+0xe0): first defined here
/tmp/ccQA9Cdv.o: In function `getMedian':
scales.cpp:(.text+0x170): multiple definition of `getMedian'
/tmp/ccobJhw2.o:grader.c:(.text+0x170): first defined here
/tmp/ccQA9Cdv.o: In function `getHeaviest':
scales.cpp:(.text+0x190): multiple definition of `getHeaviest'
/tmp/ccobJhw2.o:grader.c:(.text+0x1f0): first defined here
/tmp/ccQA9Cdv.o: In function `getLightest':
scales.cpp:(.text+0x1b0): multiple definition of `getLightest'
/tmp/ccobJhw2.o:grader.c:(.text+0x260): first defined here
/tmp/ccQA9Cdv.o: In function `getNextLightest':
scales.cpp:(.text+0x1d0): multiple definition of `getNextLightest'
/tmp/ccobJhw2.o:grader.c:(.text+0x2d0): first defined here
/tmp/ccQA9Cdv.o: In function `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()':
scales.cpp:(.text+0x1f0): multiple definition of `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()'
/tmp/ccobJhw2.o:grader.c:(.text+0x3d0): first defined here
collect2: error: ld returned 1 exit status