# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87781 | MB81 | Election Campaign (JOI15_election_campaign) | C++17 | 955 ms | 161648 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.
// Ala be zekrellah tatmaenolgholoob ...
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define F first
#define S second
#define MP make_pair
const int maxn = 2e5+9;
const int lg = 19;
const ll mod = 1e9+7;
vector <int> g[maxn];
vector <pair<pii,int>> vec[maxn], edge[maxn];
int n, m;
int par[maxn][lg], sum[maxn][lg], sub[maxn], h[maxn], curchild[maxn], dp[maxn];
int lca (int v, int u) {
if (h[v] < h[u]) swap(v, u);
for (int i = lg - 1; i >= 0; i--)
if (par[v][i] + 1 && h[par[v][i]] >= h[u])
v = par[v][i];
if (v == u)
return v;
for (int i = lg - 1; i >= 0; i--)
if (par[v][i] != par[u][i]) {
v = par[v][i];
u = par[u][i];
}
# | 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... |