# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957274 | Icelast | Election (BOI18_election) | C++17 | 52 ms | 23552 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 <bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn = 2*1e5+5, INF = 4e18+9;
ll n, Q;
string s;
void inp(){
cin >> n;
cin >> s;
s = ' ' + s;
cin >> Q;
}
struct Node{
ll L, R, S, res;
};
ll N;
Node T[4*maxn];
Node merg(Node a, Node b){
Node res;
res.S = a.S+b.S;
res.L = max(a.L, a.S+b.L);
res.R = max(b.R, a.R+b.S);
res.res = max(max(a.S+b.res, a.res+b.S), a.L+b.R);
return res;
}
void build_segtree(){
N = 1;
while(N < n) N*=2;
for(int i = 1; i <= n; 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... |