# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424647 | Hideo | Designated Cities (JOI19_designated_cities) | C++17 | 0 ms | 0 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.
while (!del[v]){
del[v] = 1;
upd(1, 1, cnt, lr[v].fr, lr[v].sc, -((h[v] - h[p[v][0]]) - (d[v] - d[p[v][0]])));
v = p[v][0];
}
}
}
// cout << cnt << endl;
for (int i = cnt + 1; i <= n; i++)
ans[i] = s;
int q;
cin >> q;
for (int i = 1; i <= q; i++){
int e;
cin >> e;
cout << s - ans[e] << endl;
}
}