Submission #595560

#TimeUsernameProblemLanguageResultExecution timeMemory
595560ApiramScales (IOI15_scales)C++14
0 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { //1 2 3 4 5 6 // 5 - operations to get first and last value -> call median 4times then maximum or minimum 1 times // 2 - median call to get middle value // 3 call to do remaining // 10 calls to sort } void orderCoins() { vector<bool>got(7,false); int a = getMedian(1, 2, 3); got[a] = true; a = getMedian(4,5,6); got[a] = true; for (int j = 0;j<2;++j){ vector<int>cur; for (int i = 1;i<7;++i){ if (!got[i]){ cur.push_back(i); } } a = getMedian(cur[0],cur[1],cur[2]); got[a] = true; } vector<int>cur; for (int i = 1;i<7;++i){ if (!got[a]){ cur.push_back(a); } } a = getHeaviest(cur[0],cur[1],a); int ans[6]; ans[0] = a; if (a == cur[0]){ ans[5] = cur[1]; } else{ ans[5] = cur[0]; } cur.clear(); for (int i = 1;i<7;++i){ if (got[i])cur.push_back(i); } int b = getMedian(cur[0],cur[1],cur[2]); a = getMedian(b,cur[3],ans[5]); ans[3] = a; got[a] = false; cur.clear(); for (int i = 1;i<7;++i){ if (!got[i])cur.push_back(i); } a = getHeaviest(cur[0],cur[1],cur[2]); ans[4] = a; got[a] = true; a = getMedian(cur[0],cur[1],cur[2]); got[a] = true; ans[2] = a; for (int i = 1;i<6;++i){ if(!got[i])ans[1] = i; } answer(ans); return; }

Compilation message (stderr)

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