# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
261881 | Kastanda | 수도 (JOI20_capital_city) | C++11 | 475 ms | 66036 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// M
#include<bits/stdc++.h>
using namespace std;
const int N = 200005, LG = 18;
int n, k, cp, A[N], H[N], P[N][LG], M[N], C[N], SZ[N], lca[N];
vector < int > TP, Adj[N], Out[N], In[N], V[N];
void DFS(int v, int p)
{
P[v][0] = p;
for (int j = 1; j < LG; j ++)
P[v][j] = P[P[v][j - 1]][j - 1];
for (int u : Adj[v])
if (u != p)
H[u] = H[v] + 1, DFS(u, v);
}
inline int LCA(int v, int u)
{
if (H[v] < H[u])
swap(v, u);
for (int i = 0; i < LG; i ++)
if ((H[v] - H[u]) >> i & 1)
v = P[v][i];
if (v == u)
return v;
for (int i = LG - 1; ~ i; i --)
if (P[v][i] != P[u][i])
v = P[v][i], u = P[u][i];
return P[v][0];
}
void DFS2(int v)
컴파일 시 표준 에러 (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... |