제출 #427885

#제출 시각아이디문제언어결과실행 시간메모리
427885timmyfeng저울 (IOI15_scales)C++17
0 / 100
2 ms396 KiB
#include <bits/stdc++.h> using namespace std; #include "scales.h" int perm[6]; void rotate(int a, int b) { rotate(perm + a, perm + b - 1, perm + b); } void init(int t) { } void orderCoins() { perm[0] = getLightest(1, 2, 3); perm[1] = 1 + (perm[0] == 1); perm[2] = 4; perm[3] = 3 - (perm[0] == 3); perm[4] = 5; perm[5] = 6; int mid = getMedian(perm[0], perm[1], 4); if (mid == perm[0]) { rotate(0, 3); } else if (mid == 4) { rotate(1, 3); } mid = getMedian(perm[1], perm[2], perm[3]); if (mid == perm[1]) { rotate(1, 4); } else if (mid == perm[3]) { rotate(2, 4); } mid = getMedian(perm[1], perm[2], 5); if (mid == perm[1]) { if (getLightest(perm[0], perm[1], 5) == 5) { rotate(0, 5); } else { rotate(1, 5); } } else if (mid == 5) { rotate(2, 5); } else if (getHeaviest(perm[2], perm[3], 5) == perm[3]) { rotate(3, 5); } mid = getMedian(perm[1], perm[3], 6); if (mid == perm[1]) { if (getLightest(perm[0], perm[1], 6) == 6) { rotate(0, 6); } else { rotate(1, 6); } } else if (mid == 6) { if (getLightest(perm[2], perm[3], 6) == 6) { rotate(2, 6); } else { rotate(3, 6); } } else if (getHeaviest(perm[4], perm[5], 6) == perm[5]) { rotate(4, 6); } answer(perm); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:12:15: warning: unused parameter 't' [-Wunused-parameter]
   12 | void init(int t) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...