#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF (int)1e18
int pf[100001];
int cost(int s,int e){
return (pf[e]-pf[s])*(e-s);
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N,K;
cin>>N>>K;
// N=30;
vector<int>v(N);
for(int i=0;i<N;i++){
cin>>v[i];
}
for(int i=0;i<N;i++){
pf[i+1]=pf[i]+v[i];
}
int x=0;
for(int i=2;i+1<N;i++){
x+=cost(0,i)+cost(i,N)<cost(0,i-1)+cost(i-1,N)&&cost(0,i)+cost(i,N)<cost(0,i+1)+cost(i+1,N);
// cout<<cost(0,i)+cost(i,N)<<' ';
}
if(x>0)return 1;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Runtime error | 3ms | 1840 KiB | ||||
2 | Runtime error | 3ms | 2228 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Runtime error | 3ms | 2304 KiB | ||||
4 | Runtime error | 3ms | 2452 KiB | ||||
5 | Runtime error | 3ms | 2548 KiB | ||||
6 | Runtime error | 2ms | 2632 KiB | ||||
7 | Runtime error | 3ms | 2760 KiB | ||||
subtask3 | 0/10 | ||||||
8 | Runtime error | 3ms | 2872 KiB | ||||
9 | Runtime error | 3ms | 2856 KiB | ||||
10 | Runtime error | 3ms | 3116 KiB | ||||
11 | Runtime error | 3ms | 3196 KiB | ||||
12 | Runtime error | 3ms | 3284 KiB | ||||
subtask4 | 0/20 | ||||||
13 | Runtime error | 3ms | 3356 KiB | ||||
14 | Runtime error | 3ms | 3484 KiB | ||||
15 | Runtime error | 3ms | 3372 KiB | ||||
16 | Runtime error | 3ms | 3364 KiB | ||||
17 | Runtime error | 3ms | 3364 KiB | ||||
18 | Runtime error | 3ms | 3372 KiB | ||||
subtask5 | 0/29 | ||||||
19 | Runtime error | 8ms | 4892 KiB | ||||
20 | Runtime error | 8ms | 4956 KiB | ||||
21 | Runtime error | 8ms | 4844 KiB | ||||
22 | Runtime error | 8ms | 4844 KiB | ||||
23 | Runtime error | 8ms | 4908 KiB | ||||
subtask6 | 0/31 | ||||||
24 | Runtime error | 14ms | 6408 KiB | ||||
25 | Runtime error | 16ms | 6716 KiB | ||||
26 | Runtime error | 14ms | 6716 KiB | ||||
27 | Runtime error | 14ms | 6716 KiB | ||||
28 | Runtime error | 14ms | 6772 KiB | ||||
29 | Runtime error | 14ms | 6716 KiB | ||||
30 | Runtime error | 14ms | 6756 KiB | ||||
31 | Runtime error | 14ms | 6812 KiB | ||||
32 | Runtime error | 14ms | 6804 KiB | ||||
33 | Runtime error | 14ms | 6816 KiB | ||||
34 | Runtime error | 14ms | 6764 KiB | ||||
35 | Runtime error | 14ms | 6764 KiB | ||||
36 | Runtime error | 14ms | 6772 KiB | ||||
37 | Runtime error | 14ms | 6780 KiB | ||||
38 | Runtime error | 14ms | 6724 KiB | ||||
39 | Runtime error | 14ms | 6720 KiB | ||||
40 | Runtime error | 14ms | 6624 KiB |