Submission #765631

#TimeUsernameProblemLanguageResultExecution timeMemory
765631boyliguanhanScales (IOI15_scales)C++17
33.33 / 100
1 ms276 KiB
#include "scales.h" void init(int T) {} void orderCoins() { int w[] = {0,0,0,0,0,0}, w1[] = {getLightest(1,2,3),getMedian(1,2,3),getHeaviest(1,2,3)}, w2[] = {getLightest(4,5,6),getMedian(4,5,6),getHeaviest(4,5,6)}, i; int p1 = 0, p2 = 0; w[0] = getLightest(w1[0],w1[1],w2[0]); if(w[0]==w1[0]) p1=1; else p2 = 1; for(i = 1; p1<3&&p2<3; i++) { w[i] = getMedian(w[0], w1[p1],w2[p2]); if(w[i]==w1[p1]) p1++; else p2++; } while(p1<3) w[i++] = w1[p1++]; while(p2<3) w[i++] = w2[p2++]; answer(w); }

Compilation message (stderr)

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