Submission #824033

#TimeUsernameProblemLanguageResultExecution timeMemory
824033petezaGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
int cnt[2000]; int initialize(int n) { for(int i=1;i<=n;i++) cnt[i] = i; } int hasEdge(int u, int v) { if(u > v) swap(u, v); if(--cnt[v] == 1) return 1; return 0; }

Compilation message (stderr)

game.cpp: In function 'int initialize(int)':
game.cpp:4:1: warning: no return statement in function returning non-void [-Wreturn-type]
    4 | }
      | ^
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:6:13: error: 'swap' was not declared in this scope
    6 |   if(u > v) swap(u, v);
      |             ^~~~