# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1160745 | Math4Life2020 | 수도 (JOI20_capital_city) | C++20 | 1100 ms | 292376 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 1048576; const ll E = 20; const ll INF = 1e18;
ll ans = INF;
pii stlca[2*Nm]; //segtree for LCA
vector<ll> adj[Nm];
vector<ll> fadj[Nm];
ll ht[Nm];
ll radj[Nm];
ll floc[Nm];
ll C[Nm];
ll lcc[Nm]; //least common ancestor of a given C
ll xroot[Nm]; //root x of a given value
ll spos[Nm]; //position on segtree
ll ispos[Nm];
ll sts[Nm]; //subtree size
vector<pii> vroot[Nm]; //points with this root: {height, point}
set<ll> segf[Nm]; //index of segtree elements that this number points to
vector<bool> found(3*Nm,0); //found -> backtrack and fuse until you find this point
vector<bool> prc(3*Nm,0); //processed -> immediately terminate entire sequence
//NEW CONVENTION: refer to a segtree term as Nm+index
//refer to a certain color element as index
inline ll v2(ll x) {
return __builtin_ctz(x);
# | 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... |