Submission #209392

#TimeUsernameProblemLanguageResultExecution timeMemory
209392autumn_eelScales (IOI15_scales)C++14
38.46 / 100
8 ms376 KiB
#include "scales.h" #include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; void init(int T) { /* ... */ } void orderCoins() { int A=getLightest(1,2,3),B=getMedian(1,2,3),C=6-A-B; int D=getLightest(4,5,6),E=getMedian(4,5,6),F=15-D-E; int nD,nE,nF; int x=getNextLightest(A,B,C,D); if(x==A){ if(getLightest(A,B,D)==D)nD=A; else nD=-1; } else nD=x; int y=getNextLightest(A,B,C,E); if(y==A){ if(getLightest(A,B,E)==E)nE=A; else nE=-1; } else nE=y; int z=getNextLightest(A,B,C,F); if(z==A){ if(getLightest(A,B,F)==F)nF=A; else nF=-1; } else nF=z; int As[]{A,B,C},Ds[]{D,E,F},nDs[]{nD,nE,nF}; int s=0; vector<int>ans; rep(i,3){ while(s<3&&nDs[s]==As[i])ans.push_back(Ds[s++]); ans.push_back(As[i]); } while(s<3)ans.push_back(Ds[s++]); int W[6]{}; rep(i,6)W[i]=ans[i]; answer(W); }

Compilation message (stderr)

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