# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1043591 | sleepntsheep | LOSTIKS (INOI20_lostiks) | C11 | 30 ms | 34388 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <stdlib.h>
#define N 1000001
#define N_ (1<<20)
int n, s, t, *eh[N], eo[N], dep[N], up[N], par[N], sz[N], hld[N], tin[N], temp,
st[N_ * 2], uu[N], vv[N], timer, aux[N];
void add(int p, int k) {
st[p += N_] += k;
for (; p /= 2; )
st[p] = st[p * 2] + st[p * 2 + 1];
}
int query(int l, int r) {
int z = 0;
l += N_;
r += N_ + 1;
for (; l < r; l /= 2, r /= 2) {
if (l & 1) z = z + st[l++];
if (r & 1) z = st[--r] + z;
}
return z;
}
int search_rightmost(int v, int l, int r, int k) {
if (l == r) return l;
if (st[v * 2 + 1] >= k) return search_rightmost(2 * v + 1, (l+r)/2 + 1, r, k);
else return search_rightmost(2 * v, l, (l+r)/2, k - st[v * 2 + 1]);
컴파일 시 표준 에러 (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... |