Submission #433342

#TimeUsernameProblemLanguageResultExecution timeMemory
433342pliamScales (IOI15_scales)C++14
0 / 100
1 ms416 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; int known[7]; void init(int T) { /* ... */ } int find_max(){ vector<int> unknown; for(int i=1;i<=6;i++){ if(!known[i]){ unknown.push_back(i); } } if(unknown.size()<3) return 0; int ans1=getHeaviest(unknown[0],unknown[1],unknown[2]); int ans2=getHeaviest(unknown[unknown.size()-1],unknown[unknown.size()-2],unknown[unknown.size()-3]); for(auto x:unknown){ if(x!=ans1&&x!=ans2){ return getHeaviest(x,ans1,ans2); } } return 0; } void orderCoins() { for(int i=1;i<=6;i++){ known[i]=0; } int W[6]; W[5]=find_max(); known[W[5]]=1; W[4]=find_max(); known[W[4]]=1; W[3]=find_max(); known[W[3]]=1; vector<int> last; for(int i=1;i<=6;i++){ if(!known[i]) last.push_back(i); } if(last.size()<3) return; W[0]=getLightest(last[0],last[1],last[2]); W[1]=getMedian(last[0],last[1],last[2]); W[2]=getHeaviest(last[0],last[1],last[2]); answer(W); }

Compilation message (stderr)

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