Submission #1006149

#TimeUsernameProblemLanguageResultExecution timeMemory
1006149Aria_lix19Coins (IOI17_coins)C++14
Compilation error
0 ms0 KiB
#include "coins.h" vector<int> coin_flips(vector<int> b, int c) { vector<int> flips(1); int y = 0; for(int i = 0; i < 64; i++){ if(b[i] == 1) y = (y ^ i); } int f = (c ^ y); flips[0] = f; return flips; } int find_coin(vector<int> b){ int sol = 0; for(int i = 0; i < 64; i++){ if(b[i] == 1){ sol = (sol ^ i); } } return sol; }

Compilation message (stderr)

coins.cpp:3:1: error: 'vector' does not name a type
    3 | vector<int> coin_flips(vector<int> b, int c) {
      | ^~~~~~
coins.cpp:15:15: error: 'int find_coin' redeclared as different kind of entity
   15 | 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:15:15: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
   15 | int find_coin(vector<int> b){
      |               ^~~~~~
      |               std::vector
In file included from /usr/include/c++/10/vector:67,
                 from coins.h:1,
                 from coins.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
coins.cpp:15:22: error: expected primary-expression before 'int'
   15 | int find_coin(vector<int> b){
      |                      ^~~