제출 #596486

#제출 시각아이디문제언어결과실행 시간메모리
596486Elias게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #ifndef _DEBUG #include "game.h" #endif using namespace std; #define int long long vector<int> parent; // logn union find vector<int> remain; int find(int a) { return parent[a] = ((parent[a] == a) ? a : find(a)); } void initialize(int n) { parent = remain = vector<int>(N); for (int i = 0; i < N; i++) { parent[i] = i; remain[i] = N - 1; } } // if the remaining edge is queried, it exists, otherwise it doesn't. This guarantees there are at least 2 groups left until the end int hasEdge(int u, int v) { u = find(u); v = find(v); remain[u]--; remain[v]--; if (remain[u] == 0 || remain[v] == 0) { parent[u] = v; remain[v] += remain[u]; return 1; } return 0; }

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

game.cpp: In function 'void initialize(long long int)':
game.cpp:21:32: error: 'N' was not declared in this scope
   21 |  parent = remain = vector<int>(N);
      |                                ^