# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
369967 | Pulgster | Race (IOI11_race) | C++17 | 2076 ms | 69716 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 "race.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define ed <<endl;
int N;
int K;
int cur = -1;
const int mxn = 200005;
vector<vector<pair<int, int>>> adj(mxn);
vector<int> sz(mxn);
vector<int> forb(mxn);
int findCentroid(int n, int node, int par){
// cerr << imie(node) imie(par) ed;
if(n == 1){
cur = node;
return 0;
}
sz[node] = 1;
bool ok = 1;
for(int i=0;i<(int)adj[node].size();i++){
if(cur != -1){
return 0;
}
int v=adj[node][i].first;
assert(v < forb.size());
if(v != par && !forb[v]){
sz[node] += findCentroid(n, v, node);
if(cur != -1){
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... |