# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
138721 | MAMBA | Werewolf (IOI18_werewolf) | C++17 | 2458 ms | 253380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i , j ,k) for (int i = j; i < (int)k; i++)
#define pb push_back
typedef vector<int> vi;
const int N = 2e5 + 10;
struct dsu {
int par[N];
vi h[N];
unordered_map<int , int> mp[N];
dsu() {
iota(par , par + N, 0);
rep(i , 0 , N) {
mp[i][i] = 0;
h[i].pb(i);
}
}
int getPar(int v) {
return par[v] == v ? v : par[v] = getPar(par[v]);
}
bool merge(int u , int v) {
if ((v = getPar(v)) == (u = getPar(u))) return false;
if (h[u].size() < h[v].size()) swap(u , v);
for (auto e : h[v]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |