# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
109991 | IOrtroiii | Construction of Highway (JOI18_construction) | C++14 | 673 ms | 104508 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>
using namespace std;
const int N = 100100;
struct Data {
int from, to, color;
Data(int from = 0,int to = 0,int color = 0) : from(from), to(to), color(color) {}
};
int n;
vector<int> g[N];
int from[N], to[N], color[N];
int child[N], nxt[N], root[N];
int par[N], pos[N], ft[N];
deque<Data> dq[N];
void add(int p,int x) { for (; p <= n; p += p & -p) ft[p] += x; }
int get(int p) { int ans = 0; for (; p > 0; p -= p & -p) ans += ft[p]; return ans; }
void dfs(int u) {
child[u] = 1;
for (int v : g[u]) {
par[v] = u;
dfs(v);
child[u] += child[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... |