Submission #742804

#TimeUsernameProblemLanguageResultExecution timeMemory
742804Abrar_Al_SamitScales (IOI15_scales)C++17
0 / 100
1 ms340 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); if(mn[5]==4) mn[0] = getLightest(mn[0], 5, 6); else if(mn[5]==5) mn[0] = getLightest(mn[0], 4, 6); else mn[0] = 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); 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]); mn[4] = getHeaviest(x[0], x[1], x[2]); 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...