Submission #63287

#TimeUsernameProblemLanguageResultExecution timeMemory
63287hamzqq9Scales (IOI15_scales)C++14
45.45 / 100
3 ms616 KiB
#include "scales.h" void init(int T) { /* ... */ } void orderCoins() { int W[6] = {1, 2, 3, 4, 5, 6}; int mn1=getLightest(1,2,3); int mx1=getHeaviest(1,2,3); int md1=6-mn1-mx1; W[0]=mn1;W[1]=md1;W[2]=mx1; int mn2=getLightest(4,5,6); int mx2=getHeaviest(4,5,6); int md2=15-mn2-mx2; W[3]=mn2;W[4]=md2;W[5]=mx2; int bas1=0,bas2=3; int TMP[6]; int cur=0; while(bas1<3 || bas2<6) { if(bas1==3) { for(int i=bas2;i<6;i++) TMP[cur++]=W[i]; break ; } if(bas2==6) { for(int i=bas1;i<3;i++) TMP[cur++]=W[i]; break ; } if(bas1+1<3) { int mn=getLightest(W[bas1],W[bas1+1],W[bas2]); if(mn==W[bas1]) { TMP[cur++]=W[bas1++]; } else { TMP[cur++]=W[bas2++]; } } else if(bas2+1<6) { int mn=getLightest(W[bas1],W[bas2+1],W[bas2]); if(mn==W[bas1]) { TMP[cur++]=W[bas1++]; } else { TMP[cur++]=W[bas2++]; } } else { int mx=getHeaviest(W[bas1],W[bas2],TMP[0]); if(mx==W[bas1]) { TMP[cur++]=W[bas2++]; TMP[cur++]=W[bas1++]; } else { TMP[cur++]=W[bas1++]; TMP[cur++]=W[bas2++]; } } } answer(TMP); }

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...