제출 #303282

#제출 시각아이디문제언어결과실행 시간메모리
303282sofapuden게임 (IOI14_game)C++14
100 / 100
598 ms25464 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; int _n; vector<vector<int>> e; vector<int> ufa; int uf(int ind){ if(ufa[ind] == ind)return ind; ufa[ind] = uf(ufa[ind]); return ufa[ind]; } void initialize(int n) { _n = n; ufa.resize(n); iota(ufa.begin(), ufa.end(), 0); e.resize(n, vector<int> (n,1)); } int hasEdge(int u, int v) { u = uf(u); v = uf(v); if(u == v)return 1; if(e[u][v] == 1){ ufa[u] = ufa[v]; for(int i = 0; i < _n; ++i){ e[v][i]+=e[u][i]; e[i][v]+=e[i][u]; } return 1; } e[u][v]--; e[v][u]--; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...