Submission #579277

#TimeUsernameProblemLanguageResultExecution timeMemory
579277Leo121Scales (IOI15_scales)C++14
38.46 / 100
1 ms288 KiB
#include "scales.h" void init(int T) { /* ... */ } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; int res = getLightest(1, 2, 3), res3 = getHeaviest(1, 2, 3), res2, res4, res5; res2 = 6 - res - res3; res4 = getNextLightest(1, 2, 3, 4); if(res4 != res){ if(res4 == res2){ res = 4; } else if(res4 == res3){ res = res2; res2 = 4; } } else{ res5 = res; res = 4; res4 = getHeaviest(res, res2, res3); if(res4 == res3){ res = res5; } else if(res4 == res){ res = res2; res2 = res3; res3 = 4; } } int poracomodar1 = 10 - res - res2 - res3, poracomodar2, poracomodar3; res4 = getNextLightest(res, res2, res3, 5); if(res4 != res){ poracomodar2 = res; if(res4 == res2){ res = 5; } else if(res4 == res3){ res = res2; res2 = 5; } } else{ res5 = res; res = 5; res4 = getHeaviest(res, res2, res3); if(res4 == res3){ res = res5; poracomodar2 = 5; } else if(res4 == res){ res = res2; res2 = res3; res3 = 5; poracomodar2 = res5; } } res4 = getNextLightest(res, res2, res3, 6); if(res4 != res){ poracomodar3 = res; if(res4 == res2){ res = 6; } else if(res4 == res3){ res = res2; res2 = 6; } } else{ res5 = res; res = 6; res4 = getHeaviest(res, res2, res3); if(res4 == res3){ res = res5; poracomodar3 = 6; } else if(res4 == res){ res = res2; res2 = res3; res3 = 6; poracomodar3 = res5; } } W[5] = res3; W[4] = res2; W[3] = res; res = getLightest(poracomodar1, poracomodar2, poracomodar3), res2 = getHeaviest(poracomodar1, poracomodar2, poracomodar3); W[2] = res2; W[0] = res; W[1] = poracomodar1 + poracomodar2 + poracomodar3 - res - res2; 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) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:94:40: warning: 'poracomodar3' may be used uninitialized in this function [-Wmaybe-uninitialized]
   94 |     W[1] = poracomodar1 + poracomodar2 + poracomodar3 - res - res2;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
scales.cpp:94:25: warning: 'poracomodar2' may be used uninitialized in this function [-Wmaybe-uninitialized]
   94 |     W[1] = poracomodar1 + poracomodar2 + poracomodar3 - res - res2;
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...