Submission #1034188

#TimeUsernameProblemLanguageResultExecution timeMemory
1034188ZicrusScales (IOI15_scales)C++17
45.45 / 100
1 ms604 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; typedef long long ll; void init(int T) { /* ... */ } void orderCoins() { vector<int> res = {1, 2, 3, 4, 5, 6}; int a = getHeaviest(1, 2, 3); int b = getHeaviest(4, 5, 6); int c = getHeaviest(a, b, 1 == a || 1 == b ? (2 == a || 2 == b ? 3 : 2) : 1); res[5] = c; int d = c <= 3 ? getHeaviest(b, 1 == c ? 3 : 1, 2 == c ? 3 : 2) : getHeaviest(a, 4 == c ? 6 : 4, 5 == c ? 6 : 5); res[4] = d; vector<int> s; for (int i = 1; i <= 6; i++) { if (i != c && i != d) s.push_back(i); } int e = getHeaviest(s[0], s[1], s[2]); int f = getHeaviest(e, s[3], s[0] == e ? s[1] : s[0]); res[3] = f; s = vector<int>(); for (int i = 1; i <= 6; i++) { if (i != c && i != d && i != f) s.push_back(i); } res[2] = getHeaviest(s[0], s[1], s[2]); res[1] = getMedian(s[0], s[1], s[2]); res[0] = getLightest(s[0], s[1], s[2]); int W[6] = {res[0], res[1], res[2], res[3], res[4], res[5]}; answer(W); }

Compilation message (stderr)

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