# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
410924 | AlperenT | Factories (JOI14_factories) | C++17 | 5666 ms | 343816 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>
#include "factories.h"
using namespace std;
const long long N = 5e5 + 5, INF = 1e18 + 5;
long long n, cnt[N], mina[N], ans;
bool blocked[N];
struct Edge{
long long b, w;
};
vector<Edge> tree[N];
vector<Edge> parent[N];
void subtreecnt(int v, int p){
cnt[v] = 1;
for(auto e : tree[v]){
if(e.b != p && !blocked[e.b]){
subtreecnt(e.b, v);
cnt[v] += cnt[e.b];
}
}
}
int findcentroid(int v, int p, int root){
for(auto e : tree[v]){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |