Submission #1006135

#TimeUsernameProblemLanguageResultExecution timeMemory
1006135Abdullah_AlodaibiCoins (IOI17_coins)C++17
Compilation error
0 ms0 KiB
#include <coins.h> vector<int> coin_flips(vector<int> b, int c){ ll x=0; for(int i=0;i<b.size();i++){ x+=b[i]*i; x%=b.size(); } b[((c+b.size())-x)%b.size()]=(b[((c+b.size())-x)%b.size()]+1)%2; return b; } int find_coin(vector<int> b){ ll x=0; for(int i=0;i<b.size();i++){ x+=b[i]*i; x%=b.size(); } return x; }

Compilation message (stderr)

coins.cpp:2:1: error: 'vector' does not name a type
    2 | vector<int> coin_flips(vector<int> b, int c){
      | ^~~~~~
coins.cpp:11:15: error: 'int find_coin' redeclared as different kind of entity
   11 | 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:11:15: error: 'vector' was not declared in this scope
   11 | int find_coin(vector<int> b){
      |               ^~~~~~
coins.cpp:11:15: note: suggested alternatives:
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'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from coins.h:1,
                 from coins.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
coins.cpp:11:22: error: expected primary-expression before 'int'
   11 | int find_coin(vector<int> b){
      |                      ^~~