제출 #652589

#제출 시각아이디문제언어결과실행 시간메모리
652589Markomafko972게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> #define X first #define Y second #define pb push_back #define pii pair<int, int> typedef long long ll; using namespace std; const int MOD = 1e9 + 7; const ll INF = 1e18; const int OFF = (1 << 20); int prt[1505]; int kol[1505][1505]; void initialize(int n) { for (int i = 0; i < n; i++) { prt[i] = i; for (int j = 0; j < n; j++) { if (i == j) continue; kol[i][j] = 1; } } } int find(int x) { if (x == prt[x]) return x; return prt[x] = find(prt[x]); } int hasEdge(int x, int y) { x = find(x); y = find(y); if (kol[x][y] > 1) { kol[x][y]--; kol[y][x]--; return 0; } for (int i = 0; i < n; i++) { kol[x][i] += kol[y][i]; } x = prt[y]; return 1; }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:42:22: error: 'n' was not declared in this scope
   42 |  for (int i = 0; i < n; i++) {
      |                      ^