제출 #320948

#제출 시각아이디문제언어결과실행 시간메모리
320948SnowFlake7Coins (IOI17_coins)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "coins.h" vector<int> coin_flips(vector<int> b, int c) { vector<int> flips; long long x = find_coin(b); flips.push_back(x ^ c); return flips; } int find_coin(vector<int> b) { long long x = 0; for (int i = 0;i < 64;i++) { if (b[i] == 1) x ^= i; } return x; }

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

coins.cpp:4:1: error: 'vector' does not name a type
    4 | vector<int> coin_flips(vector<int> b, int c) {
      | ^~~~~~
coins.cpp:10:15: error: 'int find_coin' redeclared as different kind of entity
   10 | int find_coin(vector<int> b) {
      |               ^~~~~~
In file included from coins.cpp:2:
coins.h:4:5: note: previous declaration 'int find_coin(std::vector<int>)'
    4 | int find_coin(std::vector<int> b);
      |     ^~~~~~~~~
coins.cpp:10:15: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
   10 | int find_coin(vector<int> b) {
      |               ^~~~~~
      |               std::vector
In file included from /usr/include/c++/9/vector:67,
                 from /usr/include/c++/9/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
                 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:10:22: error: expected primary-expression before 'int'
   10 | int find_coin(vector<int> b) {
      |                      ^~~