#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>1)return 1;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1836 KiB | ||||
2 | Wrong answer | 3ms | 2252 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Wrong answer | 3ms | 2348 KiB | ||||
4 | Wrong answer | 3ms | 2536 KiB | ||||
5 | Wrong answer | 3ms | 2552 KiB | ||||
6 | Wrong answer | 3ms | 3044 KiB | ||||
7 | Wrong answer | 2ms | 2912 KiB | ||||
subtask3 | 0/10 | ||||||
8 | Runtime error | 3ms | 3012 KiB | ||||
9 | Wrong answer | 3ms | 3392 KiB | ||||
10 | Wrong answer | 3ms | 3344 KiB | ||||
11 | Wrong answer | 2ms | 3240 KiB | ||||
12 | Runtime error | 3ms | 3328 KiB | ||||
subtask4 | 0/20 | ||||||
13 | Runtime error | 3ms | 3576 KiB | ||||
14 | Runtime error | 3ms | 3516 KiB | ||||
15 | Wrong answer | 3ms | 3512 KiB | ||||
16 | Wrong answer | 3ms | 3516 KiB | ||||
17 | Wrong answer | 3ms | 3520 KiB | ||||
18 | Runtime error | 3ms | 3516 KiB | ||||
subtask5 | 0/29 | ||||||
19 | Runtime error | 8ms | 4772 KiB | ||||
20 | Runtime error | 8ms | 4832 KiB | ||||
21 | Runtime error | 8ms | 5024 KiB | ||||
22 | Runtime error | 8ms | 4964 KiB | ||||
23 | Runtime error | 8ms | 5288 KiB | ||||
subtask6 | 0/31 | ||||||
24 | Runtime error | 14ms | 6844 KiB | ||||
25 | Wrong answer | 14ms | 6896 KiB | ||||
26 | Runtime error | 16ms | 7096 KiB | ||||
27 | Wrong answer | 14ms | 7148 KiB | ||||
28 | Runtime error | 14ms | 7052 KiB | ||||
29 | Runtime error | 16ms | 7252 KiB | ||||
30 | Wrong answer | 14ms | 7252 KiB | ||||
31 | Runtime error | 14ms | 7248 KiB | ||||
32 | Runtime error | 14ms | 7248 KiB | ||||
33 | Runtime error | 14ms | 7248 KiB | ||||
34 | Runtime error | 14ms | 7248 KiB | ||||
35 | Runtime error | 14ms | 7252 KiB | ||||
36 | Runtime error | 14ms | 7364 KiB | ||||
37 | Runtime error | 14ms | 7356 KiB | ||||
38 | Runtime error | 14ms | 7248 KiB | ||||
39 | Runtime error | 14ms | 7376 KiB | ||||
40 | Wrong answer | 16ms | 7344 KiB |