제출 #1165189

#제출 시각아이디문제언어결과실행 시간메모리
1165189SmuggingSpun저울 (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>p = {1, 2, 3, 4, 5, 6}, ans; while(p.size() > 2){ int light = getLightest(p[0], p[1], p[2]); ans.emplace_back(light); p.erase(find(p.begin(), p.end(), light)); } int heavy = getHeaviest(p[0], p[1], ans[0]); ans.emplace_back(p[0] ^ p[1] ^ heavy); ans.emplace_back(heavy); answer(ans); }

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

scales.cpp: In function 'void orderCoins()':
scales.cpp:16:12: error: cannot convert 'std::vector<int>' to 'int*'
   16 |     answer(ans);
      |            ^~~
      |            |
      |            std::vector<int>
In file included from scales.cpp:2:
scales.h:10:17: note:   initializing argument 1 of 'void answer(int*)'
   10 | void answer(int W[]);
      |             ~~~~^~~