# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
81767 | chelly | Race (IOI11_race) | C++11 | 1909 ms | 107748 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;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
const int MAXN = 200005, INF = 0x3f3f3f3f;
int N, K, H[MAXN][2], L[MAXN];
int sz[MAXN];
map<int, int> best;
bool done[MAXN];
vector<pii> adj[MAXN];
queue<pii> ar;
int ans = INF, target;
void dfs (int u, int p){
sz[u]=1;
for (pii e: adj[u]){
if (e.first==p||done[e.first]) continue;
dfs(e.first, u);
sz[u]+=sz[e.first];
}
}
int centroid (int u, int p, int S){
for (pii e: adj[u]){
if (sz[e.first]*2>S&&e.first!=p&&!done[e.first]) return centroid(e.first, u, S);
}
return u;
}
void path (int u, int p, int length, int cnt){
if (length==target) ans = min(ans, cnt);
# | 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... |