Submission #764547

#TimeUsernameProblemLanguageResultExecution timeMemory
764547Penaldo07Game (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include<game.h> #include<bits/stdc++.h> using namespace std; int deg[1505]; void initialize(int n){ for(int i = 0;i < n; i++) deg[i] = n - (i + 1); } void hasEdge(int u,int v){ if(u > v) swap(u, v); if(deg[u] > 0) deg[u]--; if(deg[u] == 0) return 0; return 1; }

Compilation message (stderr)

game.cpp:9:6: error: ambiguating new declaration of 'void hasEdge(int, int)'
    9 | void hasEdge(int u,int v){
      |      ^~~~~~~
In file included from game.cpp:1:
game.h:5:5: note: old declaration 'int hasEdge(int, int)'
    5 | int hasEdge(int u, int v);
      |     ^~~~~~~
game.cpp: In function 'void hasEdge(int, int)':
game.cpp:12:27: error: return-statement with a value, in function returning 'void' [-fpermissive]
   12 |    if(deg[u] == 0) return 0;
      |                           ^
game.cpp:13:11: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |    return 1;
      |           ^