Submission #40038

#TimeUsernameProblemLanguageResultExecution timeMemory
40038igziScales (IOI15_scales)C++14
55.56 / 100
0 ms2024 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int t){ } int minimum(vector <int> v){ int t1,t2,x=v[0]; t1=getLightest(v[0],v[1],v[2]); if(t1==x) x=v[1]; t2=getLightest(t1,x,v[3]); return t2; } void orderCoins(){ int t1,t2,x,i,a=-1,b=-1; vector <int> v,u; t1=getLightest(1,2,3); t2=getLightest(4,5,6); x=1; if(t1==1) x=2; x=getLightest(t1,t2,x); v.push_back(x); if(t1==x){ for(i=1;i<=3;i++){ if(i!=t1){ if(a==-1) a=i; else b=i; } } x=getLightest(t2,a,b); } else{ for(i=4;i<=6;i++){ if(i!=t2){ if(a==-1) a=i; else b=i; } } x=getLightest(t1,a,b); } v.push_back(x); for(i=1;i<=6;i++){ if(i!=v[0] && i!=v[1]) u.push_back(i); } v.push_back(minimum(u)); u.clear(); for(i=1;i<=6;i++){ if(i!=v[0] && i!=v[1] && i!=v[2]) u.push_back(i); } v.push_back(getLightest(u[0],u[1],u[2])); v.push_back(getMedian(u[0],u[1],u[2])); for(i=1;i<=6;i++){ if(i!=v[0] && i!=v[1] && i!=v[2] && i!=v[3] && i!=v[4]) v.push_back(i); } int ans[7]; for(i=0;i<6;i++){ ans[i]=v[i]; } answer(ans); }

Compilation message (stderr)

scales.cpp:6:15: warning: unused parameter 't' [-Wunused-parameter]
 void init(int t){
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...