# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
212692 | PinkRabbit | 별자리 3 (JOI20_constellation3) | C++14 | 723 ms | 99064 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <algorithm>
#include <vector>
typedef long long LL;
const int MN = 200005, MM = 200005, MS = 4000005;
int N, A[MN], Root;
std::vector<int> G[MN];
void BuildCartesianTree() {
static int stk[MN], tp, x;
auto Add = [](int u, int v) {
if (v) G[u].push_back(v);
};
for (int i = 1; i <= N; ++i) {
for (x = 0; tp && A[stk[tp]] < A[i]; --tp)
Add(stk[tp], x), x = stk[tp];
Add(i, x), stk[++tp] = i;
}
for (x = 0; tp; --tp)
Add(stk[tp], x), x = stk[tp];
Root = x;
}
int dep[MN], par[MN][18];
void DFS(int u, int pa) {
dep[u] = dep[par[u][0] = pa] + 1;
for (int j = 0; 2 << j < dep[u]; ++j)
par[u][j + 1] = par[par[u][j]][j];
컴파일 시 표준 에러 (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... |