Submission #31259

#TimeUsernameProblemLanguageResultExecution timeMemory
31259top34051Scales (IOI15_scales)C++14
0 / 100
0 ms2024 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; int A[5], B[5], p[5]; void init(int T) { } void orderCoins() { int i,j,x,t,ok,pos; int W[] = {1, 2, 3, 4, 5, 6}; A[0] = getLightest(1,2,3); A[1] = getMedian(1,2,3); for(x=1;x<=3;x++) if(x!=A[0] && x!=A[1]) A[2] = x; B[0] = getLightest(4,5,6); B[1] = getMedian(4,5,6); for(x=4;x<=6;x++) if(x!=B[0] && x!=B[1]) B[2] = x; for(i=0;i<3;i++) p[i] = getNextLightest(A[0],A[1],A[2],B[i]); t = getNextLightest(B[0],B[1],B[2],A[2]); ok = 0; for(i=0;i<3;i++) { if(t==B[i]) ok = 1; if(ok) p[i] = -1; } pos = 0; for(i=j=0;i<3;i++) { while(j<3 && p[j]==A[i]) W[pos++] = B[j++]; W[pos++] = A[i]; } while(j<3) W[pos++] = B[j++]; answer(W); }

Compilation message (stderr)

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