Submission #404661

#TimeUsernameProblemLanguageResultExecution timeMemory
404661DaktoScales (IOI15_scales)C++17
45.45 / 100
1 ms296 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { } bool contains(vector<int>& v, int x){ return find(v.begin(),v.end(), x)!=v.end(); } void orderCoins() { vector<int> res; while(res.size()<4){ vector<int> p,op; for(int i=1; i<=6; i++){ if(!contains(res,i)){ p.push_back(i); } } op=p; while(p.size()>1){ set<int> q; for(int j=0; j<=2 && p.size(); j++){ q.insert(p[0]); p.erase(p.begin()); } for(int j=0; q.size()<3; j++) q.insert(op[j]); p.push_back(getLightest(*begin(q),*next(begin(q)),*next(begin(q),2))); } res.push_back(p[0]); } vector<int> p; for(int i=1; i<=6; i++){ if(!contains(res,i)){ p.push_back(i); } } auto x=getHeaviest(p[0],p[1],res[0]); p.erase(find(p.begin(),p.end(),x)); res.push_back(p[0]); res.push_back(x); int out[6]; for(int i=0; i<6; i++) out[i]=res[i]; answer(out); }

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