# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
750579 | jmyszka2007 | 공장들 (JOI14_factories) | C++17 | 3689 ms | 375648 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "factories.h"
#include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
typedef long long ll;
constexpr int LIM = 5e5;
vector<pair<int, int> >g[LIM + 10];
vector<pair<int, ll> >cen[LIM + 10];
ll cnt[LIM + 10];
int siz[LIM + 10];
bool vis[LIM + 10];
void cntsiz(int v, int o) {
siz[v] = 1;
for(auto x : g[v]) {
if(x.st != o) {
cntsiz(x.st, v);
siz[v] += siz[x.st];
}
}
}
void cntdist(int v, int o, int kt, ll d) {
cen[v].push_back({kt, d});
for(auto x : g[v]) {
if(x.st != o && !vis[x.st]) {
cntdist(x.st, v, kt, d + x.nd);
}
}
}
int find(int a) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |