# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223188 | lyc | Putovanje (COCI20_putovanje) | C++14 | 147 ms | 17784 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;
#define SZ(x) (int)(x).size()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for (int i=(a);i>=(b);--i)
const int MX_N = 2e5+5;
int N;
vector<tuple<int,int,int>> al[MX_N];
struct FenwickTree {
vector<int> ft;
int n;
void init(int _n) {
n = _n;
ft.assign(n+1,0);
}
void u(int i, int x) { for (; i <= n; i += i&-i) ft[i] += x; }
int query(int i) { int sum = 0; for (; i; i -= i&-i) sum += ft[i]; return sum; }
void update(int i, int j, int x) { u(i,x); u(j+1,-x); }
} ft;
pair<int,int> weight[MX_N];
/* custom ds of you choice */
int cnt = 1;
int pa[MX_N], dep[MX_N];
int heavy[MX_N], head[MX_N], pos[MX_N];
// heavy stores the heavy child of this vertex
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |