Submission #30541

#TimeUsernameProblemLanguageResultExecution timeMemory
30541ozaslanScales (IOI15_scales)C++14
0 / 100
0 ms1120 KiB
#include "scales.h" void init(int T) { /* ... */ } void orderCoins() { /* ... */ int W[] = {0, 0, 0, 0, 0, 0}; int b1, o1, k1, b2, o2, k2; b1 = getHeaviest(1, 2, 3); o1 = getMedian(1, 2, 3); k1 = 6 - (b1 + o1); b2 = getHeaviest(4, 5, 6); o2 = getMedian(4, 5, 6); k2 = 15 - (b2 + o2); int o = getMedian(b1, b2, o1); if (o == o1) { W[5] = b1; W[4] = o1; o = getMedian(b2, o2, k1); if (o = b2) { W[3] = k1; W[2] = b2; W[1] = o2; W[0] = k2; answer(W); return; } if (o == k1) { W[3] = b2; W[2] = k1; W[1] = o2; W[0] = k2; answer(W); return; } W[3] = b2; W[2] = o2; int ek = getLightest(k1, k2, o2); W[1] = (ek == k1) ? k2 : k1; W[0] = ek; } else if (o == b1) { W[5] = b2; o = getMedian(b1, o1, o2); if (o == b1) { W[4] = o2; o = getMedian(b1, o1, k2); if (o == b1) { W[3] = k2; W[2] = b1; W[1] = o1; W[0] = k1; answer(W); return; } if (o == k2) { W[3] = b1; W[2] = k2; W[1] = o1; W[0] = k1; answer(W); return; } W[3] = b1; W[2] = o1; int ek = getMedian(k1, k2, o2); W[1] = (ek == k1) ? k2 : k1; W[0] = (ek == k1) ? k1 : k2; answer(W); return; } } else if (o == b2) { W[5] = b1; o = getMedian(b2, o2, o1); if (o == b2) { W[4] = o1; o = getMedian(b2, o2, k1); if (o == b2) { W[3] = k1; W[2] = b2; W[1] = o2; W[0] = k2; answer(W); return; } if (o == k1) { W[3] = b2; W[2] = k1; W[1] = o2; W[0] = k2; answer(W); return; } W[3] = b2; W[2] = o2; int ek = getMedian(k2, k1, o1); W[1] = (ek == k2) ? k1 : k2; W[0] = (ek == k2) ? k2 : k1; answer(W); return; } } }

Compilation message (stderr)

scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:28:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if (o = b2) {
             ^
#Verdict Execution timeMemoryGrader output
Fetching results...