Submission #751901

#TimeUsernameProblemLanguageResultExecution timeMemory
751901SebScales (IOI15_scales)C++17
45.45 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { return; } void orderCoins() { int W[] = {1, 2, 3, 4, 5, 6}; int a,b,c=1,in,aux; a = getHeaviest(W[0],W[1],W[2]); b = getHeaviest(W[3],W[4],W[5]); while (c==a || c==b) c++; aux = getHeaviest(a,b,c); for (int i=0;i<6;i++) if (aux==W[i]) in = i; swap(W[in],W[5]); a = getHeaviest(W[0],W[1],W[2]); b = getHeaviest(W[3],W[4],a); for (int i=0;i<5;i++) if (b==W[i]) in = i; swap(W[in],W[4]); a = getHeaviest(W[0],W[1],W[2]); b = getMedian(a,W[5],W[3]); for (int i=0;i<4;i++) if (b==W[i]) in = i; swap(W[in],W[3]); a = getHeaviest(W[0],W[1],W[2]); for (int i=0;i<3;i++) if (a==W[i]) in = i; swap(W[in],W[2]); a = getMedian(W[0],W[1],W[2]); for (int i=0;i<3;i++) if (a==W[i]) in = i; swap(W[in],W[1]); 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...