Submission #395049

#TimeUsernameProblemLanguageResultExecution timeMemory
395049rainboy저울 (IOI15_scales)C11
71.43 / 100
1 ms264 KiB
#include "scales.h" void init(int T) {} void orderCoins() { static int aa[6]; int a, b, c, d, e, f, x, tmp, i; c = getHeaviest(1, 2, 3), a = c % 3 + 1, b = (c + 1) % 3 + 1, d = getMedian(c, 4, 5); if (d == c) { if (getLightest(d, 4, 5) == 4) e = 4, f = 5; else e = 5, f = 4; aa[0] = getLightest(a, b, e); aa[1] = getMedian(a, b, e); aa[2] = aa[0] ^ aa[1] ^ (a ^ b ^ e); aa[3] = c, aa[4] = f; } else { if (getLightest(a, b, c) == b) tmp = a, a = b, b = tmp; x = getNextLightest(a, b, c, d), e = d ^ 4 ^ 5; if (x == b) { aa[2] = d, aa[3] = b, aa[4] = c; if (getLightest(a, d, e) == a) aa[0] = a, aa[1] = e; else aa[0] = e, aa[1] = a; } else if (x == c) { aa[3] = d, aa[4] = c; x = getMedian(a, b, e); if (x == b) aa[0] = a, aa[1] = b, aa[2] = e; else if (x == e) aa[0] = a, aa[1] = e, aa[2] = b; else aa[0] = e, aa[1] = a, aa[2] = b; } else { if (getLightest(a, b, d) == d) aa[0] = e, aa[1] = d, aa[2] = a, aa[3] = b, aa[4] = c; else aa[0] = a, aa[1] = b, aa[2] = c, aa[3] = d, aa[4] = e; } } x = getMedian(aa[1], aa[2], 6); if (x == 6) aa[5] = aa[4], aa[4] = aa[3], aa[3] = aa[2], aa[2] = 6; else if (x == aa[1]) { if (getMedian(aa[0], aa[1], 6) == 6) aa[5] = aa[4], aa[4] = aa[3], aa[3] = aa[2], aa[2] = aa[1], aa[1] = 6; else aa[5] = aa[4], aa[4] = aa[3], aa[3] = aa[2], aa[2] = aa[1], aa[1] = aa[0], aa[0] = 6; } else { x = getMedian(aa[3], aa[4], 6); if (x == 6) aa[5] = aa[4], aa[4] = 6; else if (x == aa[3]) aa[5] = aa[4], aa[4] = aa[3], aa[3] = 6; else aa[5] = 6; } answer(aa); }

Compilation message (stderr)

scales.c: In function 'init':
scales.c:3:15: warning: unused parameter 'T' [-Wunused-parameter]
    3 | void init(int T) {}
      |           ~~~~^
scales.c: In function 'orderCoins':
scales.c:7:32: warning: unused variable 'i' [-Wunused-variable]
    7 |  int a, b, c, d, e, f, x, tmp, i;
      |                                ^
#Verdict Execution timeMemoryGrader output
Fetching results...