Submission #668505

#TimeUsernameProblemLanguageResultExecution timeMemory
668505LittleCubeScales (IOI15_scales)C++17
55.56 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> #define ll long long using namespace std; void init(int T) { } /* int getMedian(int A, int B, int C); int getHeaviest(int A, int B, int C); int getLightest(int A, int B, int C); int getNextLightest(int A, int B, int C, int D); */ void orderCoins() { deque<int> v1(3), v2(3); v1[0] = getLightest(1, 2, 3); v1[1] = getMedian(1, 2, 3); v1[2] = v1[0] ^ v1[1]; v2[0] = getLightest(4, 5, 6); v2[1] = getMedian(4, 5, 6); v2[2] = ((v2[0] - 3) ^ (v2[1] - 3)) + 3; int ans[6], i = 0; for (; i < 3; i++) { ans[i] = getLightest(v1[0], v1[1], v2[0]); if (ans[i] == v1[0]) v1.pop_front(); else v2.pop_front(); if (v1.size() < v2.size()) swap(v1, v2); } if (v2.empty()) { ans[3] = v1[0]; ans[4] = v1[1]; ans[5] = v1[2]; } else { i--; int res = getNextLightest(ans[i], v1[0], v1[1], v2[0]); if (res == ans[i]) { ans[3] = v1[0]; ans[4] = v1[1]; ans[5] = v2[0]; } else if (res == v1[0]) { ans[3] = v2[0]; ans[4] = v1[0]; ans[5] = v1[1]; } else { ans[3] = v1[0]; ans[4] = v2[0]; ans[5] = v1[1]; } } answer(ans); }

Compilation message (stderr)

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