제출 #1199438

#제출 시각아이디문제언어결과실행 시간메모리
1199438raphaelp저울 (IOI15_scales)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int T) { } void orderCoins() { vector<int> W(6); int L, H, ML, MH1, MH2; L = getLowest(1, 2, 3); ML = (L == 1) ? 2 : 1; MH1 = (L == 3) ? 2 : 3; H = getHighest(MH1, 4, 5); if (MH1 == H) MH1 = 4; MH2 = (H == 5) ? 4 : 5; int x = getMedian(L, ML, MH1); if (x == L) swap(MH1, L), swap(ML, MH1); else if (x == MH1) swap(MH1, ML); x = getMedian(MH1, MH2, H); if (x == H) swap(H, MH1), swap(MH1, MH2); else if (x == MH1) swap(MH1, MH2); x = getMedian(MH1, MH2, 6); if (x == 6) W = {L, ML, MH1, 6, MH2, H}; else if (x == MH1) { x = getMedian(L, ML, 6); if (x == 6) W = {L, 6, ML, MH1, MH2, H}; else if (x == L) W = {6, L, ML, MH1, MH2, H}; else W = {L, ML, 6, MH1, MH2, H}; } else { x = getMedian(MH2, H, 6); if (x == 6) W = {L, ML, MH1, MH2, 6, H}; else W = {L, ML, MH1, MH2, H, 6}; } int ans[6]; for (int i = 0; i < 6; i++) ans[i] = W[i]; answer(ans); }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'void orderCoins()':
scales.cpp:14:9: error: 'getLowest' was not declared in this scope
   14 |     L = getLowest(1, 2, 3);
      |         ^~~~~~~~~
scales.cpp:17:9: error: 'getHighest' was not declared in this scope; did you mean 'getLightest'?
   17 |     H = getHighest(MH1, 4, 5);
      |         ^~~~~~~~~~
      |         getLightest