# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947433 | weakweakweak | 수도 (JOI20_capital_city) | C++17 | 180 ms | 94932 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;
int lt[510000], rt[510000], cnt[510000], n, k, col[510000], revlt[510000], now = 0, l[510000], r[510000];
int pos[510000] = {0};
vector<int> e[510000];
vector<int> qs[510000];
set<int> st[510000];
int a[510000] = {0};
void update (int i, int val) {
for (; i <= n; i += i & -i) a[i] += val;
}
int query (int i) {
int res = 0;
for (; i > 0; i -= i & -i) res += a[i];
return res;
}
int query2 (int l, int r) {return query(r) - query(l - 1);}
void dfs (int i, int par) {
lt[i] = ++now, revlt[now] = i;
for (int j : e[i]) if (j != par) dfs(j, i);
rt[i] = now;
}
# | 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... |