Submission #411246

#TimeUsernameProblemLanguageResultExecution timeMemory
411246nxteruScales (IOI15_scales)C++14
71.43 / 100
1 ms296 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } void orderCoins() { vector<int>a[6]; a[2].push_back(getLightest(1,2,3)); for(int i=1;i<=3;i++){ if(i!=a[2][0])a[3].push_back(i); } a[3].push_back(getHeaviest(4,5,6)); for(int i=4;i<=6;i++){ if(i!=a[3][2])a[2].push_back(i); } a[0].push_back(getLightest(a[2][0],a[2][1],a[2][2])); a[5].push_back(getHeaviest(a[3][0],a[3][1],a[3][2])); for(auto i:a[2])if(i!=a[0][0])a[1].push_back(i); for(auto i:a[3])if(i!=a[5][0])a[1].push_back(i); a[2].clear(); a[3].clear(); a[4].push_back(getHeaviest(a[1][0],a[1][1],a[1][2])); for(auto i:a[1])if(i!=a[4][0])a[2].push_back(i); a[1].clear(); a[1].push_back(getLightest(a[2][0],a[2][1],a[2][2])); for(auto i:a[2])if(i!=a[1][0])a[3].push_back(i); a[2].clear(); a[3].push_back(a[4][0]); a[4].clear(); int m=getMedian(a[3][0],a[3][1],a[3][2]); for(int i=0;i<3;i++){ if(a[3][i]!=m){ a[2].push_back(a[3][i]); break; } } for(int i=2;i>=0;i--){ if(a[3][i]!=m){ a[4].push_back(a[3][i]); break; } } a[3].clear(); a[3].push_back(m); int w[6]; for(int i=0;i<6;i++)w[i]=a[i][0]; answer(w); }

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...