제출 #856230

#제출 시각아이디문제언어결과실행 시간메모리
856230Hakiers게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e3 + 7; bool edge[MAXN][MAXN]; int deg[MAXN]; int hasEdge(int u, int v){ if(!edge[u][v]){ if(min(deg[v], deg[u]) == 1) return 1; deg[u]--; deg[v]--; edge[u][v] = edge[v][u] = 1; return 0; } else{ return 0; } void initg(int n){ for(int i = 1; i <= n; i++) deg[i] = n-1; } void initialize(int n){ initg(n); }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:25:18: error: a function-definition is not allowed here before '{' token
   25 | void initg(int n){
      |                  ^
game.cpp:33:23: error: a function-definition is not allowed here before '{' token
   33 | void initialize(int n){
      |                       ^
game.cpp:36:1: error: expected '}' at end of input
   36 | }
      | ^
game.cpp:7:26: note: to match this '{'
    7 | int hasEdge(int u, int v){
      |                          ^