Submission #770947

#TimeUsernameProblemLanguageResultExecution timeMemory
770947teokakabadzeScales (IOI15_scales)C++17
0 / 100
1 ms468 KiB
#include "scales.h" #include<bits/stdc++.h> #define f first #define s second #define pb push_back #define ll long long #define pii pair<int, int> using namespace std; int i, a[6], k; void init(int T) { /* ... */ } void orderCoins() { a[0] = getLightest(1, 2, 3); a[1] = getMedian(1, 2, 3); for(i = 1; i <= 3; i++) if(i != a[0] && i != a[1]) a[2] = i; k = getNextLightest(1, 2, 3, 4); if(k == a[1]) a[3] = a[2], a[2] = a[1], a[1] = 4; else if(k == a[2]) a[3] = a[2], a[2] = 4; else { k = getLightest(a[0], a[1], 4); if(k == 4) a[3] = a[2], a[2] = a[1], a[1] = a[0], a[0] = 4; else a[3] = 4; } k = getNextLightest(a[0], a[1], a[2], 5); if(k == a[1]) a[4] = a[3], a[3] = a[2], a[2] = a[1], a[1] = 5; else if(k == a[2]) a[4] = a[3], a[3] = a[2], a[2] = 5; else { k = getMedian(a[0], a[3], 5); if(k == a[0]) a[4] = a[3], a[3] = a[2], a[2] = a[1], a[1] = a[0], a[0] = 5; else if(k == a[3]) a[4] = 5; else a[4] = a[3], a[3] = 5; } k = getNextLightest(a[0], a[2], a[4], 6); if(k == a[2]) { k = getLightest(a[1], a[2], 6); if(k == a[1]) a[5] = a[4], a[4] = a[3], a[3] = a[2], a[2] = 6; else a[5] = a[4], a[4] = a[3], a[3] = a[2], a[2] = a[1], a[1] = 6; } else if(k == a[4]) { k = getLightest(a[3], a[4], 6); if(k == a[3]) a[5] = a[4], a[4] = 6; else a[5] = a[4], a[4] = a[3], a[3] = 6; } else { k = getLightest(a[0], a[5], 6); if(k == a[0]) a[5] = 6; else a[5] = a[4], a[4] = a[3], a[3] = a[2], a[2] = a[1], a[1] = a[0], a[0] = 6; } answer(a); }

Compilation message (stderr)

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