# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313423 | Vince729 | Election (BOI18_election) | C++11 | 621 ms | 20276 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<string>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN = 500002;
const int MOD = 1000000007;
struct node {
int lmx, rmx, sum, ans;
node operator+(node o) {
node ret;
ret.lmx = max(lmx, o.lmx+sum);
ret.rmx = max(rmx+o.sum, o.rmx);
ret.sum = sum+o.sum;
ret.ans = max(max(ans+o.sum, sum+o.ans), lmx+o.rmx);
return ret;
}
};
int n, q;
bool votes[MAXN];
node st[1<<20];
void build(int l=1, int r=n, int x=1) {
if (l == r) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |