Submission #791801

#TimeUsernameProblemLanguageResultExecution timeMemory
791801JosiaScales (IOI15_scales)C++17
45.45 / 100
1 ms300 KiB
#include "scales.h" using namespace std; #include <bits/stdc++.h> void init(int T) { /* ... */ } void orderCoins() { int a1 = getLightest(1, 2, 3); int a2 = getMedian(1, 2, 3); set<int> a = {1,2,3}; a.erase(a1); a.erase(a2); int a3 = *a.begin(); int b1 = getLightest(4,5,6); int b2 = getMedian(4,5,6); set<int> b = {4,5,6}; b.erase(b1); b.erase(b2); int b3 = *b.begin(); deque<int> A, B; A = {a1, a2, a3}; B = {b1, b2, b3}; vector<int> res; res.push_back(getLightest(A[0], A[1], B[0])); if (res[0] == B[0]) B.pop_front(); else A.pop_front(); while (A.size() && B.size()) { res.push_back(getMedian(res[0], A[0], B[0])); if (res.back() == B[0]) B.pop_front(); else A.pop_front(); } for (int i:A) res.push_back(i); for (int i:B) res.push_back(i); int W[] = {1,2,3,4,5,6}; for (int i = 0; i<6; i++) { W[i] = res[i]; // cerr << res[i] << " "; } // cerr << "\n"; 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...