제출 #176427

#제출 시각아이디문제언어결과실행 시간메모리
176427FieryPhoenix게임 (IOI14_game)C++11
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <map> #include <queue> #include <set> #include <iomanip> #include <deque> #include <cassert> #include <ctime> #include <cstring> #include <cstdlib> #include <chrono> #include <ctime> #include <random> #include <stack> #include <unordered_set> #include <unordered_map> #include <iterator> #include <climits> #include "game.h" using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; #define INF 2001001001 #define MOD 1000000007 vector<int>rt,siz; int N; map<int,int>queried[1501]; int root(int x){ while (x!=rt[x]){ rt[x]=rt[rt[x]]; x=rt[x]; } return x; } void merge(int a, int b){ a=root(a); b=root(b); if (siz[a]<siz[b]) swap(a,b); for (auto it:queried[b]){ queried[a][it.first]+=it.second; queried[it.first][a]+=queried[it.first][b]; queried[it.first].erase(b); } queried[b].clear(); siz[a]+=siz[b]; rt[b]=a; } void initialize(int N){ for (int i=0;i<N;i++) rt.push_back(i); for (int i=0;i<N;i++) siz.push_back(1); } int hasEdge(int U, int V){ U=root(u[C]); V=root(v[C]); if (U==V) return 0; queried[U][V]++; queried[V][U]++; if (queried[U][V]==siz[U]*siz[V]){ merge(U,V); return 1; } else return 0; }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:69:10: error: 'u' was not declared in this scope
   U=root(u[C]);
          ^
game.cpp:69:12: error: 'C' was not declared in this scope
   U=root(u[C]);
            ^
game.cpp:70:10: error: 'v' was not declared in this scope
   V=root(v[C]);
          ^