Submission #292357

#TimeUsernameProblemLanguageResultExecution timeMemory
292357VodkaInTheJarScales (IOI15_scales)C++14
33.33 / 100
1 ms384 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int t) { } vector <int> merge(vector <int> v, int x) { int sz = (int)v.size(); vector <int> ans; if (sz == 2) { int temp = getMedian(v[0], v[1], x); if (temp == x) return {v[0], x, v[1]}; else if (temp == v[0]) return {x, v[0], v[1]}; else return {v[0], v[1], x}; } int temp = getHeaviest(v[sz-2], v[sz-1], x); if (temp == x) { ans = v; ans.push_back(x); return ans; } else { int pre = v[sz-1]; v.pop_back(); ans = merge(v, x); ans.push_back(pre); return ans; } } int shit[6]; void orderCoins() { vector <int> ans; ans.push_back(getLightest(1, 2, 3)); ans.push_back(getMedian(1, 2, 3)); if (ans[0] != 1 && ans[1] != 1) ans.push_back(1); if (ans[0] != 2 && ans[1] != 2) ans.push_back(2); if (ans[0] != 3 && ans[1] != 3) ans.push_back(3); for (int i = 4; i <= 6; i++) ans = merge(ans, i); for (int i = 0; i < 6; i++) shit[i] = ans[i]; answer(shit); }

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