# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531883 | cadmiumsky | Synchronization (JOI13_synchronization) | C++14 | 458 ms | 23908 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 nmax = 1e5 + 5;
vector<int> g[nmax];
pair<int,int> edg[nmax];
int n;
namespace DSU {
int pin[nmax], pout[nmax], father[nmax][18], inp = 1, state[nmax],
sz[nmax], isc[nmax];
void initP(int node, int f) {
pin[node] = inp++;
father[node][0] = f;
for(int i = 1; i < 18; i++)
father[node][i] = father[father[node][i - 1]][i - 1];
for(auto x : g[node]) {
if(x == f)
continue;
initP(x, node);
}
pout[node] = inp - 1;
}
namespace AIB {
#define lsb(x) (x & -x)
int tree[nmax];
void upd(int poz, int val) {
while(poz <= n) {
tree[poz] += val;
poz += lsb(poz);
# | 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... |