Submission #589785

#TimeUsernameProblemLanguageResultExecution timeMemory
589785MilosMilutinovicScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
/** * author: wxhtzdy * created: 05.07.2022 11:10:33 **/ #include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int tt) { return; } void orderCoins() { vector<int> ans(6); int L0 = getLightest(1, 2, 3); int R0 = getLightest(4, 5, 6); int L1 = getMedian(1, 2, 3); int R1 = getMedian(1, 2, 3); int L2 = (1 ^ 2 ^ 3 ^ L0 ^ L1); int R2 = (1 ^ 2 ^ 3 ^ R0 ^ R1); ans[0] = L0; ans[1] = R0; ans[2] = L1; ans[3] = R1; ans[4] = L2; ans[5] = R2; for (int i = 0; i < 4; i++) { int idx = getLightest(ans[i], ans[i + 1], ans[i + 2]); if (ans[i + 1] == idx) { swap(ans[i], ans[i + 1]); } else if (ans[i + 2] == idx) { swap(ans[i + 1], ans[i + 2]); swap(ans[i], ans[i + 1]); } } if (getHightest(ans[3], ans[4], ans[5]) == 4) { swap(ans[4], ans[5]); } answer(ans); return; }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:10:15: warning: unused parameter 'tt' [-Wunused-parameter]
   10 | void init(int tt) {
      |           ~~~~^~
scales.cpp: In function 'void orderCoins()':
scales.cpp:37:7: error: 'getHightest' was not declared in this scope; did you mean 'getLightest'?
   37 |   if (getHightest(ans[3], ans[4], ans[5]) == 4) {
      |       ^~~~~~~~~~~
      |       getLightest
scales.cpp:40:10: error: cannot convert 'std::vector<int>' to 'int*'
   40 |   answer(ans);
      |          ^~~
      |          |
      |          std::vector<int>
In file included from scales.cpp:5:
scales.h:10:17: note:   initializing argument 1 of 'void answer(int*)'
   10 | void answer(int W[]);
      |             ~~~~^~~