# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
242823 | moonrabbit2 | Feast (NOI19_feast) | C++17 | 417 ms | 232220 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 fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<db,db> pdb;
typedef tuple<int,int,int> tii;
typedef tuple<ll,ll,ll> tll;
typedef tuple<int,int,int,int> ti4;
typedef vector<vector<ll>> mat;
const ll mod=1e9+7,inf=1e18;
const int N=3e5+5,M=2e5+5,K=1e7+5;
int n,k;
ll a[N],ans;
struct SEG{
struct node{
tll Lmx,Rmx,Sum,Mx;
tll Lmx2,Rmx2,Sum2,Mx2;
void Swap(){
swap(Lmx,Lmx2); swap(Rmx,Rmx2); swap(Sum,Sum2); swap(Mx,Mx2);
}
node operator +(node n1){
node n;
n.Lmx=max(Lmx,{get<0>(Sum)+get<0>(n1.Lmx),get<1>(Sum),get<2>(n1.Lmx)});
n.Rmx=max(n1.Rmx,{get<0>(Rmx)+get<0>(n1.Sum),get<1>(Rmx),get<2>(n1.Sum)});
n.Sum={get<0>(Sum)+get<0>(n1.Sum),get<1>(Sum),get<2>(n1.Sum)};
n.Mx=max({Mx,n1.Mx,{get<0>(Rmx)+get<0>(n1.Lmx),get<1>(Rmx),get<2>(n1.Lmx)}});
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |