이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "graderlib.c"
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
int T;
void init(int t) {
t=T;
}
struct coin{
int id;
};
int Max(int a, int b, int c){
return getHeaviest(a, b, c);
}
int Min(int a, int b, int c){
return getLightest(a, b, c);
}
int Mid(int a, int b, int c){
return getMedian(a, b, c);
}
int l[3], r[3], u[6];
void orderCoins() {
/*
int W[] = {1, 2, 3, 4, 5, 6};
answer(W);*/
l[0]=Min(1, 2, 3);
l[2]=Max(1, 2, 3);
l[1]=6-l[0]-l[2];
r[0]=Min(4, 5, 6);
r[2]=Max(4, 5, 6);
r[1]=4+5+6-r[0]-r[2];
//printf("l:%d %d %d r:%d %d %d\n", l[0], l[1], l[2], r[0], r[1], r[2]);
int cl=0, cr=0;
while(cl<2 && cr<3){
u[cl+cr]=Min(l[cl], l[cl+1], r[cr]);
if(u[cl+cr]==l[cl])cl++;
else cr++;
}
while(cr<2 && cl<3){
u[cl+cr]=Min(l[cl], r[cr+1], r[cr]);
if(u[cl+cr]==l[cl])cl++;
else cr++;
}
if(cr==2 && cl==2){//cerr<<"slucaj 1";
u[5]=Max(l[2], r[2], l[1]);
u[4]=21-u[0]-u[1]-u[2]-u[3]-u[5];
answer(u);
return;
}
if(cl==3){//cerr<<"slucaj 2";
u[5]=r[2];
u[4]=r[1];
answer(u);
return;
}
if(cr==2){//cerr<<"slucaj 3";
u[5]=l[2];
u[4]=l[1];
}
answer(u);
}
컴파일 시 표준 에러 (stderr) 메시지
In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (_ghksjhdfkae19ga_ > 1)
^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
for (i = 0; i < 6; i++) {
^~~
In file included from scales.cpp:1:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (_ghksjhdfkae19ga_ > 1)
^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
for (i = 0; i < 6; i++) {
^~~
scales.cpp: In function 'void init(int)':
scales.cpp:11:15: warning: parameter 't' set but not used [-Wunused-but-set-parameter]
void init(int t) {
^
In file included from scales.cpp:1: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/cccuKX3c.o: In function `answer':
scales.cpp:(.text+0xe0): multiple definition of `answer'
/tmp/cc4ciKtS.o:grader.c:(.text+0xe0): first defined here
/tmp/cccuKX3c.o: In function `getMedian':
scales.cpp:(.text+0x170): multiple definition of `getMedian'
/tmp/cc4ciKtS.o:grader.c:(.text+0x170): first defined here
/tmp/cccuKX3c.o: In function `getHeaviest':
scales.cpp:(.text+0x190): multiple definition of `getHeaviest'
/tmp/cc4ciKtS.o:grader.c:(.text+0x1f0): first defined here
/tmp/cccuKX3c.o: In function `getLightest':
scales.cpp:(.text+0x1b0): multiple definition of `getLightest'
/tmp/cc4ciKtS.o:grader.c:(.text+0x260): first defined here
/tmp/cccuKX3c.o: In function `getNextLightest':
scales.cpp:(.text+0x1d0): multiple definition of `getNextLightest'
/tmp/cc4ciKtS.o:grader.c:(.text+0x2d0): first defined here
/tmp/cccuKX3c.o: In function `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()':
scales.cpp:(.text+0x1f0): multiple definition of `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()'
/tmp/cc4ciKtS.o:grader.c:(.text+0x3d0): first defined here
collect2: error: ld returned 1 exit status