# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88106 | KCSC | Synchronization (JOI13_synchronization) | C++14 | 687 ms | 68468 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int DIM = 100005;
int sgt[DIM * 8], fst[DIM], lst[DIM], oans[DIM], nans[DIM], lev[DIM];
vector<int> edg[DIM]; pair<int, int> lis[DIM]; bitset<DIM> oki;
void dfs(int x, int f) {
static int cnt = 0;
fst[x] = ++cnt; lev[x] = lev[f] + 1;
for (int y : edg[x]) {
if (y != f) {
dfs(y, x); } }
lst[x] = ++cnt; }
void update(int nd, int le, int ri, int ps, int vl) {
if (le == ri) {
sgt[nd] += vl; }
else {
int md = (le + ri) / 2;
if (ps <= md) {
update(nd << 1, le, md, ps, vl); }
else {
update(nd << 1 | 1, md + 1, ri, ps, vl); }
if (lst[sgt[nd << 1]] > lst[sgt[nd << 1 | 1]]) {
sgt[nd] = sgt[nd << 1]; }
else {
sgt[nd] = sgt[nd << 1 | 1]; } } }
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |