Submission #596936

#TimeUsernameProblemLanguageResultExecution timeMemory
596936PiejanVDCScales (IOI15_scales)C++17
45.45 / 100
1 ms256 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int t) { } void orderCoins() { int ans[6] = {1, 2, 3, 4, 5, 6}; int a = getLightest(1, 2, 3); int b = getLightest(4, 5, 6); int c; for(int i = 1 ; i <= 6 ; i++) if(i != a && i != b) c = i; ans[0] = getLightest(a, b, c); vector<int>r; for(int i = 1 ; i <= 6 ; i++) if(i != ans[0]) r.push_back(i); a = getLightest(r[0], r[1], getLightest(r[2], r[3], r[4])); ans[1] = a; r.clear(); for(int i = 1 ; i <= 6 ; i++) if(i != ans[0] && i != ans[1]) r.push_back(i); a = getLightest(r[0], r[1], r[2]); r.clear(); for(int i = 1 ; i <= 6 ; i++) if(i != ans[0] && i != ans[1] && i != a) r.push_back(i); ans[2] = getLightest(a, r[0], r[2]); r.clear(); for(int i = 1 ; i <= 6 ; i++) if(i != ans[0] && i != ans[1] && i != ans[2]) r.push_back(i); ans[3] = getLightest(r[0], r[1], r[2]); r.clear(); for(int i = 1 ; i <= 6 ; i++) if(i != ans[0] && i != ans[1] && i != ans[2] && i != ans[3]) r.push_back(i); ans[5] = getHeaviest(r[0], r[1], ans[0]); for(int i = 1 ; i <= 6 ; i++) if(i != ans[0] && i != ans[1] && i != ans[2] && i != ans[3] && i != ans[5]) ans[4] = i; answer(ans); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 't' [-Wunused-parameter]
    5 | void init(int t) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:17:25: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
   17 |     ans[0] = getLightest(a, b, c);
      |              ~~~~~~~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...