# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
810324 | vuavisao | Feast (NOI19_feast) | C++17 | 81 ms | 12152 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<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define ll long long
using namespace std;
const ll N = 3e5 + 10;
const ll INF = 1e18;
struct dsu {
ll n = 0;
vector<ll> parent = {};
void resize(ll _n) {
n = _n;
parent.resize(n + 10); for(ll i = 1; i <= n; ++ i) parent[i] = i;
}
dsu() {};
dsu(ll _n) { this -> resize(_n); };
ll ancestor(ll u) {
if(parent[u] == u) return u;
return parent[u] = ancestor(parent[u]);
}
bool join(ll u, ll v) {
u = ancestor(u); v = ancestor(v);
if(u == v) return false;
parent[v] = u;
return true;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |