제출 #1060482

#제출 시각아이디문제언어결과실행 시간메모리
1060482vjudge1게임 (IOI14_game)C++17
0 / 100
1 ms2500 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef long long ll; typedef pair<long long, long long> pll; typedef pair<char, int> ci; typedef pair<string, int> si; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; #define pb push_back #define fi first #define se second #define whole(v) v.begin(), v.end() #define rwhole(v) v.rbegin(), v.rend() #define inf INT_MAX/2 #define fro front int len[2000]; int f[2000]; int aris[1501][1501]; int ffather(int i){ if(f[i] == i){ return i; } return ffather(f[i]); } void join(int u, int v){ u = ffather(u); v = ffather(v); if(u == v){ return; } if(len[u] > len[v]){ swap(u, v); } f[u] = v; len[v] += len[u]; } void initialize(int n) { for(int i = 1; i < 2000; ++i){ f[i] = i; len[i] = 1; } } int hasEdge(int u, int v){ u++; v++; u = ffather(u); v = ffather(v); aris[u][v]++; if(aris[u][v] == len[u] * len[v]){ join(u, v); return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...