Submission #136879

#TimeUsernameProblemLanguageResultExecution timeMemory
136879AyaBenSaadScales (IOI15_scales)C++14
45.45 / 100
3 ms380 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int T) { } int ans[6]; int a[5], b[5]; void orderCoins() { a[1] = getLightest (1, 2, 3); b[1] = getLightest (4, 5, 6); a[2] = getMedian (1, 2, 3); b[2] = getMedian (4, 5, 6); a[3] = 1+2+3-a[1]-a[2]; b[3] = 4+5+6-b[1]-b[2]; ans[0] = getLightest(a[1], b[1], b[2]); int l = 1, r = 1; if (ans[0] == a[1]) l++; else if (ans[0] == b[1]) r++; ans[1] = getLightest(a[l], b[r], b[3]); if (ans[1] == a[l]) l++; else if (ans[1] == b[r]) r++; ans[2] = getLightest(a[l], b[r], (r == 3 ? a[3] : b[3])); if (ans[2] == a[l]) l++; else if (ans[2] == b[r]) r++; if (l > 3) ans[3] = getLightest(b[1], b[2], b[3]); else if (r > 3) ans[3] = getLightest (a[1], a[2], a[3]); else if (l <= 3 && r <= 3) ans[3] = getLightest(a[l], b[r], (r == 3 ? a[3] : b[3])); if (ans[3] == a[l]) l++; else if (ans[3] == b[r]) r++; if(l > 3) ans[4] = getMedian(ans[0], b[2], b[3]); else if(r > 3) ans[4] = getMedian(ans[0], a[2], a[3]); else ans[4] = getMedian(ans[0], a[3], b[3]); ans[5] = (6*7)/2 - (ans[0]+ans[1]+ans[2]+ans[3]+ans[4]); answer(ans); }

Compilation message (stderr)

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