# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
943368 | THXuan | Race (IOI11_race) | C++14 | 1209 ms | 54092 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 <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#define INF 1e9
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
int n, k;
int ans = INF;
vector<pair<int, int>>adj[MAXN];
bool visited[MAXN];
ll dp[MAXN];
vector<int>v;
vector<int>cnt(1e6 + 5, 1e9);
int get_size(int s, int e) {
dp[s] = 1;
for (auto u : adj[s]) {
if (u.first == e || visited[u.first]) continue;
get_size(u.first, s);
dp[s] += dp[u.first];
}
return dp[s];
}
int get_centroid(int s, int e, int n) {
# | 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... |