# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387466 | jeroenodb | Synchronization (JOI13_synchronization) | C++14 | 306 ms | 23392 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 all(x) begin(x),end(x)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 1e5;
const ll oo = 1e18;
namespace hld {
int n;
int chain[mxN],sz[mxN], parent[mxN],in[mxN], info[mxN], uploaded[mxN] = {};
// vector<edge> edges;
vi adj[mxN];
vector<pi> edges;
set<int,greater<int>> sets[mxN];
int cnt = 0;
void dfs(int at=0, int path=-1) {
int min = in[at] = cnt++;
chain[min] = (path==-1)?min:path;
sets[chain[min]].insert(min);
if(adj[at].empty())
return;
int mx=-2,heavy = -1;
for(int to: adj[at]) {
if(sz[to] > mx) {
mx = sz[to];
heavy=to;
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |