제출 #333065

#제출 시각아이디문제언어결과실행 시간메모리
333065gouravkhungerCoins (IOI17_coins)C++14
컴파일 에러
0 ms0 KiB
#include "coins.h" std::vector<int> coin_flips(std::vector<int> b, int c) { std::vector<int> flips; for(int i=0;i<64;i++) { if(i==c&&b[c]==0) flips.push_back(i); else { if(b[i]==1) flips.push_back(i); } } return flips; } int find_coin(vector<int> b) { for(auto a:b) if(a==1) return a; }

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

coins.cpp:14:15: error: 'int find_coin' redeclared as different kind of entity
   14 | int find_coin(vector<int> b) {
      |               ^~~~~~
In file included from coins.cpp:1:
coins.h:4:5: note: previous declaration 'int find_coin(std::vector<int>)'
    4 | int find_coin(std::vector<int> b);
      |     ^~~~~~~~~
coins.cpp:14:15: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
   14 | int find_coin(vector<int> b) {
      |               ^~~~~~
      |               std::vector
In file included from /usr/include/c++/9/vector:67,
                 from coins.h:1,
                 from coins.cpp:1:
/usr/include/c++/9/bits/stl_vector.h:386:11: note: 'std::vector' declared here
  386 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
coins.cpp:14:22: error: expected primary-expression before 'int'
   14 | int find_coin(vector<int> b) {
      |                      ^~~