Submission #67167

#TimeUsernameProblemLanguageResultExecution timeMemory
67167MKopchevGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "game.h" const int nmax=1.5e3+42; int target[nmax]; void initialize(int n) { for(int i=0;i<n;i++) target[i]=n-i-1; } bool hasEdge(int u,int v) { int e=min(u,v); target[e]--; if(target[e]==0)return 1; return 0; }

Compilation message (stderr)

game.cpp: In function 'bool hasEdge(int, int)':
game.cpp:10:6: error: ambiguating new declaration of 'bool hasEdge(int, int)'
 bool hasEdge(int u,int v)
      ^~~~~~~
In file included from game.cpp:2:0:
game.h:5:5: note: old declaration 'int hasEdge(int, int)'
 int hasEdge(int u, int v);
     ^~~~~~~
game.cpp:12:11: error: 'min' was not declared in this scope
     int e=min(u,v);
           ^~~
game.cpp:12:11: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from game.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3456:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~