# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64197 | someone_aa | Election (BOI18_election) | C++17 | 1593 ms | 47128 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 ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 500100;
vector<pair<int,int>>events[maxn];
int arr[maxn], answer[maxn], n, q;
struct node {
public:
int l, r;
int sum, minsuf;
} tree[4*maxn];
node mergef(node a, node b) {
node c;
c.l = a.l; c.r = b.r;
c.sum = a.sum + b.sum;
c.minsuf = min(b.minsuf, a.minsuf + b.sum);
return c;
}
void build(int li=1, int ri=n, int index=1) {
if(li == ri) {
tree[index].l = li; tree[index].r = ri;
tree[index].sum = arr[li];
tree[index].minsuf = min(0, arr[li]);
}
else {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |