Submission #742807

#TimeUsernameProblemLanguageResultExecution timeMemory
742807Abrar_Al_Samit저울 (IOI15_scales)C++17
45.45 / 100
1 ms276 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]); 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...