# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
126593 | fjzzq2002 | 공장들 (JOI14_factories) | C++14 | 2990 ms | 111344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "factories.h"
#include <bits/stdc++.h>
using namespace std;
#define SZ 2234567
typedef long long ll;
int n,M=0,fst[SZ],vb[SZ],nxt[SZ]; ll vc[SZ];
void ad_de(int a,int b,ll c)
{
++M; nxt[M]=fst[a]; fst[a]=M;
vb[M]=b; vc[M]=c;
}
void adde(int a,int b,ll c)
{
ad_de(a,b,c); ad_de(b,a,c);
}
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
int dep[SZ],sz[SZ],so[SZ],fa[SZ]; ll dd[SZ];
void dfs1(int x,int fa=0)
{
sz[x]=1; dep[x]=dep[fa]+1; ::fa[x]=fa;
for esb(x,e,b) if(b!=fa)
{
dd[b]=dd[x]+vc[e];
dfs1(b,x),sz[x]+=sz[b];
if(sz[b]>sz[so[x]]) so[x]=b;
}
}
int top[SZ],dn[SZ],D,rv[SZ];
void dfs2(int x,int t,int fa=0)
{
컴파일 시 표준 에러 (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... |