제출 #63263

#제출 시각아이디문제언어결과실행 시간메모리
63263Kubalionzzale저울 (IOI15_scales)C++14
45.45 / 100
4 ms700 KiB
#include "scales.h" int ans[] = {1, 2, 3, 4, 5, 6}; int left[5], right[5]; void init(int T) { /* ... */ } void ask(int leftCnt, int rightCnt, int index) { if (leftCnt >= 3) { for (int i = rightCnt; i <= 2; ++i) { ans[index + i - rightCnt] = right[i]; } return; } else if (rightCnt >= 3) { for (int i = leftCnt; i <= 2; ++i) { ans[index + i - leftCnt] = left[i]; } return; } if (rightCnt <= 1) { int val = getLightest(left[leftCnt], right[rightCnt], right[rightCnt + 1]); if (val == left[leftCnt]) { ans[index] = left[leftCnt]; ++leftCnt; ask(leftCnt, rightCnt, index + 1); } else { ans[index] = right[rightCnt]; ++rightCnt; ask(leftCnt, rightCnt, index + 1); } } else { int val = getMedian(left[leftCnt], right[rightCnt - 1], right[rightCnt]); if (val == left[leftCnt]) { ans[index] = left[leftCnt]; ++leftCnt; ask(leftCnt, rightCnt, index + 1); } else { ans[index] = right[rightCnt]; ++rightCnt; ask(leftCnt, rightCnt, index + 1); } } } void orderCoins() { int used[7] = { 0 }; left[0] = getLightest(1, 2, 3); left[1] = getMedian(1, 2, 3); ++used[left[0]]; ++used[left[1]]; for (int i = 1; i <= 3; ++i) { if (!used[i]) left[2] = i; } right[0] = getLightest(4, 5, 6); right[1] = getMedian(4, 5, 6); ++used[right[0]]; ++used[right[1]]; for (int i = 4; i <= 6; ++i) { if (!used[i]) right[2] = i; } int leftCnt = 0, rightCnt = 0; ask(leftCnt, rightCnt, 0); answer(ans); }

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