Submission #384662

#TimeUsernameProblemLanguageResultExecution timeMemory
384662qpwoeirutScales (IOI15_scales)C++17
45.45 / 100
1 ms364 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { } void orderCoins() { int W[] = {1, 2, 3, 4, 5, 6}; int mn1 = getLightest(1, 2, 3); int mn2 = getLightest(4, 5, 6); int other = 1; for (; other<=6 && (mn1 == other || mn2 == other); ++other); assert(mn1 != other && mn2 != other); W[0] = getLightest(mn1, mn2, other); vector<int> coins; for (int i=1; i<=6; ++i) if (i != W[0]) coins.push_back(i); assert(coins.size() == 5); mn1 = getLightest(coins[0], coins[1], coins[2]); W[1] = getLightest(coins[3], coins[4], mn1); coins.erase(find(coins.begin(), coins.end(), W[1])); mn1 = getLightest(coins[0], coins[1], coins[2]); W[2] = getLightest(coins[3], mn1, coins[0] == mn1 ? coins[1] : coins[0]); coins.erase(find(coins.begin(), coins.end(), W[2])); assert(coins.size() == 3); W[3] = getLightest(coins[0], coins[1], coins[2]); W[4] = getMedian(coins[0], coins[1], coins[2]); for (int i=0; i<3; ++i) { if (coins[i] != W[3] && coins[i] != W[4]) W[5] = coins[i]; } answer(W); }

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...