# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015386 | Hanksburger | Election Campaign (JOI15_election_campaign) | C++17 | 163 ms | 55648 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;
int par[100005][20], sum[100005][20], depth[100005], dp1[100005], dp2[100005];
vector<pair<pair<int, int>, int> > vec[100005];
vector<pair<int, int> > upd[100005];
vector<int> adj[100005];
int lca(int u, int v)
{
if (depth[u]<depth[v])
swap(u, v);
int d=depth[u]-depth[v];
for (int i=19; i>=0; i--)
if (d&(1<<i))
u=par[u][i];
if (u==v)
return u;
for (int i=19; i>=0; i--)
{
if (par[u][i]!=par[v][i])
{
u=par[u][i];
v=par[v][i];
}
}
return par[u][0];
}
int calc(int u, int d)
{
int res=0;
for (int i=19; i>=0; i--)
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |