제출 #677751

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6777512023-01-04 09:53:50AlcabelHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
100 / 100
1171 ms79460 KiB
#include <bits/stdc++.h>
using namespace std;
const int maxn = (1 << 20);
struct SegTree {
int n;
int st[2 * maxn];
SegTree() {}
SegTree(int _n) {
if (_n == 1) {
n = _n;
} else {
n = (1 << (31 - __builtin_clz(_n - 1) + 1));
}
for (int i = 0; i < 2 * n; ++i) {
st[i] = 0;
}
}
void update(int v, int tl, int tr, int i, int val) {
// cerr << "v: " << v << ", tl: " << tl << ", tr: " << tr << ", i: " << i << ", val: " << val << '\n';
if (tl + 1 == tr) {
st[v] = val;
return;
}
int m = tl + (tr - tl) / 2;
if (i < m) {
update(2 * v, tl, m, i, val);
} else {
update(2 * v + 1, m, tr, i, val);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...