Submission #333062

#TimeUsernameProblemLanguageResultExecution timeMemory
333062gouravkhungerCoins (IOI17_coins)C++14
Compilation error
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; }

Compilation message (stderr)

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:6:23: error: lvalue required as left operand of assignment
    6 |         if(i==c&&b[c]=0) flips.push_back(i);
      |                       ^
coins.cpp: At global scope:
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) {
      |                      ^~~