Submission #589795

#TimeUsernameProblemLanguageResultExecution timeMemory
589795MilosMilutinovic저울 (IOI15_scales)C++14
0 / 100
1 ms224 KiB
/** * author: wxhtzdy * created: 05.07.2022 11:10:33 **/ #include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int tt) { return; } void orderCoins() { int ans[6]; int L0 = getLightest(1, 2, 3); // 3 int R0 = getLightest(4, 5, 6); // 4 int L1 = getMedian(1, 2, 3); // 2 int R1 = getMedian(4, 5, 6); // 6 int L2 = (1 ^ 2 ^ 3 ^ L0 ^ L1); // 1 int R2 = (4 ^ 5 ^ 6 ^ R0 ^ R1); // 5 int mn = getLightest(L0, R0, L1); // 3 ans[0] = mn; // 3 ans[1] = (mn ^ L0 ^ R0); // 4 ans[2] = L1; // 2 ans[3] = R1; // 6 ans[4] = L2; // 1 ans[5] = R2; // 5 for (int i = 0; i < 3; i++) { int idx = getNextLightest(ans[i + 1], ans[i + 2], ans[i + 3], ans[i]); // 4 if (ans[i + 2] == idx) { swap(ans[i + 1], ans[i + 2]); } else if (ans[i + 3] == idx) { swap(ans[i + 2], ans[i + 3]); swap(ans[i + 1], ans[i + 2]); } } if (getHeaviest(ans[3], ans[4], ans[5]) == ans[4]) { swap(ans[4], ans[5]); } answer(ans); return; }

Compilation message (stderr)

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