# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
418661 | parsabahrami | Subtree (INOI20_subtree) | C++17 | 2075 ms | 33028 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("O2", "fast-math")
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
#define SZ(x) (int) x.size()
#define F first
#define S second
const int N = 1e5 + 10, MOD = 1e9 + 7;
int dp[N], M[N], dp2[N], up[N], P[N], H[N], rt[N], fr[N], to[N], n, m; vector<int> vec[N], adj[N];
int pd[N];
void add(int &x, int y) {
x += y;
if (x >= MOD) x -= MOD;
if (x < 0) x += MOD;
}
int Find(int v) { return !rt[v] ? v : rt[v] = Find(rt[v]); }
void Union(int u, int v) {
u = Find(u), v = Find(v);
if (u == v) return;
vec[v].push_back(u);
rt[u] = v;
}
Compilation message (stderr)
# | 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... |