제출 #702727

#제출 시각아이디문제언어결과실행 시간메모리
702727math_rabbit_1028게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int root[1515], dep[1515], can[1515], comp, last; void initialize(int n) { for (int i = 0; i < n; i++) cnt[i] = 0; } int hasEdge(int u, int v) { if (u > v) swap(u, v); cnt[v]++; if (cnt[v] == v) return 1; else return 0; }

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

game.cpp: In function 'void initialize(int)':
game.cpp:7:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |     for (int i = 0; i < n; i++) cnt[i] = 0;
      |                                 ^~~
      |                                 int
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:12:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |     cnt[v]++;
      |     ^~~
      |     int
game.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^