Submission #136999

#TimeUsernameProblemLanguageResultExecution timeMemory
136999arthurconmyScales (IOI15_scales)C++14
45.45 / 100
2 ms380 KiB
#include <bits/stdc++.h> using namespace std; #ifndef ARTHUR_LOCAL #include "scales.h" #endif int t; void init(int T) { t=T; } void orderCoins() { vector<int> cur = {1,2,3,4,5,6}; vector<int> ans; for(int dot=1; dot<=4; dot++) { int cur_min = getLightest(cur[0],cur[1],cur[2]); int not_min=-1; if(cur_min==cur[0]) not_min=cur[1]; else not_min=cur[0]; if(dot<4) { int add_on = not_min; if(dot<3) add_on=cur[4]; cur_min=getLightest(cur_min,cur[3],add_on); } if(dot==1) { cur_min = getLightest(cur_min,not_min,cur[5]); } ans.push_back(cur_min); vector<int> new_cur; for(auto c:cur) { if(c!=cur_min) new_cur.push_back(c); } cur=new_cur; } ans.push_back(getMedian(ans.back(),cur[0],cur[1])); ans.push_back(cur[0]+cur[1]-ans.back()); // for(auto a:ans) cout << a << " "; int A[6]; for(int i=0; i<6; i++) A[i]=ans[i]; answer(A); }
#Verdict Execution timeMemoryGrader output
Fetching results...