제출 #268586

#제출 시각아이디문제언어결과실행 시간메모리
268586A02저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include "scales.h" #include <vector> #include <set> #include <algorithm> #include <utility> using namespace std; void init(int T) { /* ... */ } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; int l1 = getLightest(1, 2, 3); int l2 = getLightest(4, 5, 6); int s = 1; if (1 == l1){ s = 2; } int l = getLightest(l1, l2, s); vector<int> remaining; for (int i = 1; i <= 6; i++){ if (i != l){ remaining.push_back(i); } } int l1 = getNextLightest(remaining[0], remaining[1], remaining[2], l); int l2 = getNextLightest(remaining[4], remaining[5], l1, l); W[0] = l; W[1] = l2; remaining.erase(remaining.find(l2)); int l3 = getNextLightest(remaining[0], remaining[1], remaining[2], l2); int l4 = getNextLightest(remaining[3], l, l3, l2); W[2] = l4; remaining.erase(remaining.find(l4)); int l5 = getNextLightest(remaining[0], remaining[1], remaining[2], l3); W[3] = l5; W[4] = getMedian(remaining[0], remaining[1], remaining[2]); remaining.erase(remaining.find(W[3])); remaining.erase(remaining.find(W[4])); W[5] = remaining[0]; answer(W); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:9:15: warning: unused parameter 'T' [-Wunused-parameter]
    9 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:32:9: error: redeclaration of 'int l1'
   32 |     int l1 = getNextLightest(remaining[0], remaining[1], remaining[2], l);
      |         ^~
scales.cpp:17:9: note: 'int l1' previously declared here
   17 |     int l1 = getLightest(1, 2, 3);
      |         ^~
scales.cpp:33:9: error: redeclaration of 'int l2'
   33 |     int l2 = getNextLightest(remaining[4], remaining[5], l1, l);
      |         ^~
scales.cpp:18:9: note: 'int l2' previously declared here
   18 |     int l2 = getLightest(4, 5, 6);
      |         ^~
scales.cpp:37:31: error: 'class std::vector<int>' has no member named 'find'
   37 |     remaining.erase(remaining.find(l2));
      |                               ^~~~
scales.cpp:44:31: error: 'class std::vector<int>' has no member named 'find'
   44 |     remaining.erase(remaining.find(l4));
      |                               ^~~~
scales.cpp:52:31: error: 'class std::vector<int>' has no member named 'find'
   52 |     remaining.erase(remaining.find(W[3]));
      |                               ^~~~
scales.cpp:53:31: error: 'class std::vector<int>' has no member named 'find'
   53 |     remaining.erase(remaining.find(W[4]));
      |                               ^~~~