제출 #1079202

#제출 시각아이디문제언어결과실행 시간메모리
1079202hirayuu_oj게임 (IOI13_game)C++17
컴파일 에러
0 ms0 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

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 | }
      | ^