# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41319 | nibnalin | Election Campaign (JOI15_election_campaign) | C++14 | 411 ms | 172892 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 <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int maxn = int(2e5)+5, maxlog = 19;
int n, ctr = 0, st[4*maxn+10], start[maxn], en[maxn], H[maxn], dp[maxn], T[maxn][maxlog+1];
vector<int> graph[maxn];
vector<int> C[maxn];
vector<pair<int, int>> A[maxn];
vector<pair<int, int>> B[maxn];
inline int left(int node) { return (node<<1); }
inline int right(int node) { return (node<<1)+1; }
void upd(int node, int L, int R, int a, int b, int v)
{
if(a > R || b < L) return;
else if(a <= L && R <= b) st[node] += v;
else
{
upd(left(node), L, (L+R)/2, a, b, v);
upd(right(node), (L+R)/2+1, R, a, b, v);
}
}
int qry(int node, int L, int R, int a)
{
if(L == R) return st[node];
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... |