103102024-03-30 14:14:36111Majomházcpp17Runtime error 0/10016ms6816 KiB
#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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error3ms1840 KiB
2Runtime error3ms2228 KiB
subtask20/10
3Runtime error3ms2304 KiB
4Runtime error3ms2452 KiB
5Runtime error3ms2548 KiB
6Runtime error2ms2632 KiB
7Runtime error3ms2760 KiB
subtask30/10
8Runtime error3ms2872 KiB
9Runtime error3ms2856 KiB
10Runtime error3ms3116 KiB
11Runtime error3ms3196 KiB
12Runtime error3ms3284 KiB
subtask40/20
13Runtime error3ms3356 KiB
14Runtime error3ms3484 KiB
15Runtime error3ms3372 KiB
16Runtime error3ms3364 KiB
17Runtime error3ms3364 KiB
18Runtime error3ms3372 KiB
subtask50/29
19Runtime error8ms4892 KiB
20Runtime error8ms4956 KiB
21Runtime error8ms4844 KiB
22Runtime error8ms4844 KiB
23Runtime error8ms4908 KiB
subtask60/31
24Runtime error14ms6408 KiB
25Runtime error16ms6716 KiB
26Runtime error14ms6716 KiB
27Runtime error14ms6716 KiB
28Runtime error14ms6772 KiB
29Runtime error14ms6716 KiB
30Runtime error14ms6756 KiB
31Runtime error14ms6812 KiB
32Runtime error14ms6804 KiB
33Runtime error14ms6816 KiB
34Runtime error14ms6764 KiB
35Runtime error14ms6764 KiB
36Runtime error14ms6772 KiB
37Runtime error14ms6780 KiB
38Runtime error14ms6724 KiB
39Runtime error14ms6720 KiB
40Runtime error14ms6624 KiB