# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
868468 | t6twotwo | Two Currencies (JOI23_currencies) | C++17 | 900 ms | 33572 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct HLD {
bool e;
int n, timer;
vector<int> sz, dep, par, top, pos;
vector<vector<int>> adj;
HLD(int m, bool edge) : n(m), e(edge) {
sz.resize(n);
dep.resize(n);
top.resize(n);
pos.resize(n);
adj.resize(n);
par.resize(n);
}
void add_edge(int x, int y) {
adj[x].push_back(y);
adj[y].push_back(x);
}
void init(int x) {
sz[x] = 1;
for (int &y : adj[x]) {
dep[y] = dep[x] + 1;
adj[y].erase(find(adj[y].begin(), adj[y].end(), par[y] = x));
init(y);
sz[x] += sz[y];
if (sz[y] > sz[adj[x][0]]) {
swap(y, adj[x][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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |