# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481167 | Karabasan | Election (BOI18_election) | C++17 | 1681 ms | 29924 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;
#define ll long long
#define forn(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define sz(a) (int)a.size()
const int N = 5e5;
struct node{
int pref;
int suf;
int sum;
int ans;
};
node t[4 * N];
int a[N];
node merge(node a, node b){
node c;
c.sum = a.sum + b.sum;
c.pref = max(a.pref, a.sum + b.pref);
c.suf = max(b.suf, b.sum + a.suf);
c.ans = max({0, a.pref + b.suf, a.sum + b.ans, b.sum + a.ans});
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |