제출 #72845

#제출 시각아이디문제언어결과실행 시간메모리
72845square1001저울 (IOI15_scales)C++14
0 / 100
3 ms620 KiB
#include "scales.h" #include <vector> using namespace std; void init(int T) { /* ... */ } void orderCoins() { vector<int> vl(3), vr(3); vl[0] = getLightest(1, 2, 3); vl[1] = getMedian(1, 2, 3); vl[2] = 6 - vl[0] - vl[1]; vr[0] = getLightest(4, 5, 6); vr[1] = getMedian(4, 5, 6); vr[2] = 15 - vr[0] - vr[1]; int dl = getNextLightest(vr[0], vr[1], vr[2], vl[1]); int dr = getNextLightest(vl[0], vl[1], vl[2], vr[1]); dl = (dl == vr[0] ? 1 : (dl == vr[1] ? 2 : 3)); dr = (dr == vl[0] ? 1 : (dr == vl[1] ? 2 : 3)); if(dl == 1) dl = (dr == 3 ? 1 : 4); if(dr == 1) dr = (dl == 3 ? 1 : 4); if(dl > dr) { swap(dl, dr); swap(vl, vr); } vector<int> w(6); w[dl] = vl[1]; w[dr] = vr[1]; if(dl == 1) w[0] = vl[0]; if(dr == 4) w[5] = vr[2]; if(dl == 1 && dr == 4) { w[2] = getLightest(vl[2], vr[0], vr[2]); w[3] = vl[2] + vr[0] - w[2]; } if(dl == 1 && dr == 3) { w[2] = vr[0]; w[5] = getHeaviest(vl[2], vr[2], vl[0]); w[4] = vl[2] + vr[2] - w[5]; } if(dl == 2 && dr == 4) { w[3] = vl[2]; w[0] = getLightest(vl[0], vr[0], vr[2]); w[1] = vl[0] + vr[0] - w[0]; } if(dl == 2 && dr == 3) { w[0] = getLightest(vl[0], vr[0], vr[2]); w[1] = vl[0] + vr[0] - w[0]; w[5] = getHeaviest(vl[2], vr[2], vl[0]); w[4] = vl[2] + vr[2] - w[5]; } int W[] = {w[0], w[1], w[2], w[3], w[4], w[5]}; answer(W); }

컴파일 시 표준 에러 (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++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...