Submission #619479

#TimeUsernameProblemLanguageResultExecution timeMemory
619479BERNARB01Scales (IOI15_scales)C++17
45.45 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; #ifdef B01 #include "../debb.h" #else #define deb(...) #endif const int n = 6; void init(int T) { } inline int getO(int i) { return (i + 1) % 3; } inline int getOO(int i) { return (i + 2) % 3; } void orderCoins() { int mnl = getLightest(1, 2, 3); int mnr = getLightest(4, 5, 6); int mxl = getHeaviest(1, 2, 3); int mxr = getHeaviest(4, 5, 6); int mn = getLightest(mnl, mnr, getO(mnl - 1) + 1); int mx = getHeaviest(mxl, mxr, getO(mxl - 1) + 1); int mn2 = (mn == mnl ? getLightest(mnr, getO(mnl - 1) + 1, getOO(mnl - 1) + 1) : getLightest(mnl, getO(mnr - 4) + 4, getOO(mnr - 4) + 4)); int mx2 = (mx == mxl ? getHeaviest(mxr, getO(mxl - 1) + 1, getOO(mxl - 1) + 1) : getHeaviest(mxl, getO(mxr - 4) + 4, getOO(mxr - 4) + 4)); set<int> se = {1, 2, 3, 4, 5, 6}; se.erase(mn); se.erase(mn2); se.erase(mx2); vector<int> z(se.begin(), se.end()); int l = getLightest(z[0], z[1], z[2]); se.erase(mx); se.erase(l); vector<int> w = {mn, mn2, l, *se.begin(), mx2, mx}; answer(w.data()); }

Compilation message (stderr)

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