# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
935711 | OAleksa | Regions (IOI09_regions) | C++14 | 8064 ms | 112344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
const int N = 2e5 + 69;
const int R = 25069;
const int K = 17;
const int B = 300;
int n, q, r, a[N], cnt[R];
int timer, tin[N], tout[N], up[N][K];
int st[R * K * 15], lc[R * K * 15], rc[R * K * 15];
int root[N], node, l[R];
map<pair<int, int>, int> was;
vector<int> g[N], clr[R];
void modify(int v, int v1, int tl, int tr, int pos) {
if (tl == tr)
st[v] = st[v1] + 1;
else {
int mid = (tl + tr) / 2;
if (pos <= mid) {
lc[v] = ++node;
rc[v] = rc[v1];
modify(lc[v], lc[v1], tl, mid, pos);
}
else {
rc[v] = ++node;
lc[v] = lc[v1];
modify(rc[v], rc[v1], mid + 1, tr, pos);
}
st[v] = st[lc[v]] + st[rc[v]];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |