제출 #693797

#제출 시각아이디문제언어결과실행 시간메모리
693797T0p_게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int n; int pa[1500], sz[1500]; ิbool Asked[1500][1500]; vector<int> g[1500]; int fp(int u) { return pa[u] = (u == pa[u]) ? u : fp(pa[u]); } void initialize(int N) { n = N; for (int i=0 ; i<n ; i++) { pa[i] = i; sz[i] = 1; } } int hasEdge(int u, int v) { Asked[u][v] = Asked[v][u] = true; int uu = fp(u), vv = fp(v); if (uu == vv) return 0; int cntAsked = 0; stack<int> s1; s1.push(uu); while (!s1.empty()) { int u = s1.top(); s1.pop(); stack<int> s2; s2.push(vv); while (!s2.empty()) { int v = s2.top(); s2.pop(); if (Asked[u][v]) cntAsked += 1; for (int x : g[v]) s2.push(x); } for (int x : g[u]) s1.push(x); } if (cntAsked != sz[uu] * sz[vv]) return 0; pa[vv] = uu; sz[uu] += sz[vv]; return 1; }

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

game.cpp:7:1: error: '\U00000e34bool' does not name a type; did you mean 'bool'?
    7 | ิbool Asked[1500][1500];
      | ^~~~
      | bool
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:24:5: error: 'Asked' was not declared in this scope
   24 |     Asked[u][v] = Asked[v][u] = true;
      |     ^~~~~