# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
882197 | abcvuitunggio | Synchronization (JOI13_synchronization) | C++17 | 276 ms | 36372 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>
#define int long long
using namespace std;
int n,m,q,x[100001],y[100001],d,c,last[100001],s[100001],res[100001],tin[100001],tout[100001],t,p[100001][20],ft[100001][2];
vector <int> ke[100001];
void update(int i, int j, int val){
for (;i<=n;i+=i&(-i))
ft[i][j]+=val;
}
int get(int i, int j){
int res=0;
for (;i;i-=i&(-i))
res+=ft[i][j];
return res;
}
int get(int u){
return get(tout[u],1)-get(tin[u]-1,1);
}
void dfs(int u, int par){
tin[u]=++t;
for (int v:ke[u])
if (v!=par){
p[v][0]=u;
for (int i=1;i<20;i++)
p[v][i]=p[p[v][i-1]][i-1];
dfs(v,u);
}
tout[u]=t;
}
int f(int u){
# | 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... |