Submission #652590

#TimeUsernameProblemLanguageResultExecution timeMemory
652590Markomafko972Game (IOI14_game)C++14
0 / 100
1 ms304 KiB
#include "game.h" #include <bits/stdc++.h> #define X first #define Y second #define pb push_back #define pii pair<int, int> typedef long long ll; using namespace std; const int MOD = 1e9 + 7; const ll INF = 1e18; const int OFF = (1 << 20); int prt[1505]; int kol[1505][1505]; int maxi; void initialize(int n) { maxi = n; for (int i = 0; i < n; i++) { prt[i] = i; for (int j = 0; j < n; j++) { if (i == j) continue; kol[i][j] = 1; } } } int find(int x) { if (x == prt[x]) return x; return prt[x] = find(prt[x]); } int hasEdge(int x, int y) { x = find(x); y = find(y); if (kol[x][y] > 1) { kol[x][y]--; kol[y][x]--; return 0; } for (int i = 0; i < maxi; i++) { kol[x][i] += kol[y][i]; } x = prt[y]; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...