Submission #1079202

# Submission time Handle Problem Language Result Execution time Memory
1079202 2024-08-28T11:59:00 Z hirayuu_oj Game (IOI13_game) C++17
Compilation error
0 ms 0 KB
#include "game.h"
vector<int> cnt;
void initialize(int n){
    cnt.resize(n,n-1);
}
int hasEdge(int u, int v){
    cnt[u]--;cnt[v]--;
    if(cnt[u]==0||cnt[v]==0)return 1;
    else return 0;
}

Compilation message

game.cpp:2:1: error: 'vector' does not name a type
    2 | vector<int> cnt;
      | ^~~~~~
game.cpp: In function 'void initialize(int)':
game.cpp:4:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
    4 |     cnt.resize(n,n-1);
      |     ^~~
      |     int
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:7:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |     cnt[u]--;cnt[v]--;
      |     ^~~
      |     int
game.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^