# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145427 | MKopchev | Election (BOI18_election) | C++14 | 914 ms | 45524 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=5e5+42;
int n,q;
char in[nmax],inp[nmax];
vector< pair<int/*right*/,int/*id*/> > seen[nmax];
int output[nmax];
vector<int> active_t;
struct info
{
int sum;
int least_suffix;
};
info tree[4*nmax];
info my_merge(info l,info r)
{
info ret;
ret.sum=l.sum+r.sum;
ret.least_suffix=min(r.least_suffix,l.least_suffix+r.sum);
return ret;
}
void update(int node,int l,int r,int pos,int val)
{
if(l==r)
{
tree[node].sum=val;
tree[node].least_suffix=min(0,val);
return;
}
int av=(l+r)/2;
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... |