Submission #356670

#TimeUsernameProblemLanguageResultExecution timeMemory
356670leinad2Scales (IOI15_scales)C++17
33.63 / 100
1 ms364 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; void init(int T) { } void orderCoins() { int ans[7]={}, i; int x=getHeaviest(1, 2, 3); int y=getLightest(1, 2, 3); for(i=1;i<=3;i++)if(i!=x&&i!=y)break; ans[0]=x; ans[1]=i; ans[2]=y; int z=getNextLightest(ans[0], ans[1], ans[2], 4); if(z==ans[0]) { ans[3]=ans[2]; ans[2]=ans[1]; ans[1]=4; } if(z==ans[1]) { ans[3]=ans[2]; ans[2]=4; } if(z==ans[2]) {int w=getHeaviest(x, i, 4); if(w==4) { ans[3]=y; ans[2]=i; ans[1]=x; ans[0]=4; } else ans[3]=4; } int xx=getHeaviest(ans[0], ans[1], 5); if(xx==5) { ans[4]=ans[3];ans[3]=ans[2];ans[2]=ans[1];ans[1]=ans[0];ans[0]=5; } else { int xxxx=getNextLightest(ans[1], ans[2], ans[3], 5); if(xxxx==ans[1]) { ans[4]=ans[3];ans[3]=ans[2];ans[2]=5; } if(xxxx==ans[2]) { ans[4]=ans[3];ans[3]=5; } if(xxxx==ans[3]) { int xxx=getHeaviest(ans[1], ans[2], 5); if(xxx==5) { ans[4]=ans[3];ans[3]=ans[2];ans[2]=ans[1];ans[1]=5; } else ans[4]=5; } } int xxxxx=getHeaviest(ans[0], ans[1], 6); if(xxxxx==6) { ans[5]=ans[4];ans[4]=ans[3];ans[3]=ans[2];ans[2]=ans[1];ans[1]=ans[0];ans[0]=6; } else { int xxxxxx=getHeaviest(ans[1], ans[2], 6); if(xxxxxx==6) { ans[5]=ans[4];ans[4]=ans[3];ans[3]=ans[2];ans[2]=ans[1];ans[1]=6; } else { int xxxxxxx=getHeaviest(ans[2], ans[3], 6); if(xxxxxxx==6) { ans[5]=ans[4];ans[4]=ans[3];ans[3]=ans[2];ans[2]=6; } else { int xxxxxxxx=getNextLightest(ans[2], ans[3], ans[4], 6); if(xxxxxxxx==ans[2]) { ans[5]=ans[4];ans[4]=ans[3];ans[3]=6; } if(xxxxxxxx==ans[3]) { ans[5]=ans[4];ans[4]=6; } if(xxxxxxxx==ans[4]) { ans[5]=6; } } } } int ans2[6]; for(i=0;i<6;i++)ans2[i]=ans[5-i]; answer(ans2); return; }

Compilation message (stderr)

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