# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1126084 | tvgk | 공장들 (JOI14_factories) | C++20 | 8090 ms | 12564 KiB |
#include "factories.h"
#include<bits/stdc++.h>
using namespace std;
#define task "a"
#define se second
#define fi first
#define ll long long
#define ii pair<ll, ll>
const long mxN = 5e5 + 7;
int par[mxN][25], par_Cen[mxN], h[mxN], child[mxN];
bool del[mxN];
ll dis[mxN][25], mn[mxN];
vector<ii> w[mxN];
void Buildlog(int j)
{
for (int i = 1; i < __lg(h[j]); i++)
{
par[j][i] = par[par[j][i - 1]][i - 1];
dis[j][i] = dis[j][i - 1] + dis[par[j][i - 1]][i - 1];
}
}
void Build_LCA(int j)
{
Buildlog(j);
for (ii i : w[j])
{
if (h[i.fi])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |