# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
727424 | model_code | Cat Exercise (JOI23_ho_t4) | C++17 | 404 ms | 59888 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define MAX_N 200010
ll n,p[MAX_N],a[MAX_N],b[MAX_N];
vll g[MAX_N];
struct LCA{
#define D 20
ll depth[MAX_N],par[MAX_N][D];
void dfs(ll x,ll from,ll d){
depth[x]=d;
par[x][0]=from;
for(auto y:g[x])if(y!=from){
dfs(y,x,d+1);
}
}
void init(){
dfs(0,0,0);
rep(d,D-1){
rep(i,n){
par[i][d+1]=par[par[i][d]][d];
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |