Submission #743694

#TimeUsernameProblemLanguageResultExecution timeMemory
743694Abrar_Al_SamitScales (IOI15_scales)C++17
55.56 / 100
1 ms300 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { } void orderCoins() { int mn[6]; mn[0] = getLightest(1, 2, 3); mn[5] = getHeaviest(4, 5, 6); int new_mn; if(mn[5]==4) new_mn = getLightest(mn[0], 5, 6); else if(mn[5]==5) new_mn = getLightest(mn[0], 4, 6); else new_mn = getLightest(mn[0], 4, 5); if(mn[0]==1) mn[5] = getHeaviest(mn[5], 2, 3); else if(mn[0]==2) mn[5] = getHeaviest(mn[5], 1, 3); else mn[5] = getHeaviest(mn[5], 1, 2); mn[0] = new_mn; int x[3], at = 0; for(int i=1; i<=6; ++i) { if(i==mn[0] || i==mn[5]) continue; x[at] = i; ++at; if(at==3) break; } mn[1] = getLightest(x[0], x[1], x[2]); at = 0; for(int i=6; i>0; --i) { if(i==mn[0] || i==mn[5] || i==mn[1]) continue; x[at] = i; ++at; if(at==2) break; } mn[1] = getLightest(mn[1], x[0], x[1]); at = 0; for(int i=1; i<=6; ++i) { if(i==mn[0] || i==mn[5] || i==mn[1]) continue; x[at] = i; ++at; } mn[2] = getLightest(x[0], x[1], x[2]); mn[3] = getMedian(x[0], x[1], x[2]); set<int>s = {1, 2, 3, 4, 5, 6}; for(int i=0; i<6; ++i) if(i!=4) { s.erase(mn[i]); } mn[4] = *s.begin(); answer(mn); }

Compilation message (stderr)

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