# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1173262 | ezzzay | Bigger segments (IZhO19_segments) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define int long long
const int N=5e5+234;
int a[N];
signed main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
int mx=0;
for(int i=1;i<=n;i++){
int s=0,cnt=1;
int ps=0;
for(int j=1;j<=n;j++){
if(j<=i){
s+=a[j];
ps=s;
continue;
}
if(i==j-1){
s=0;
}
s+=a[j];
if(s>=ps){
ps=s;
# | 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... |