103112024-03-30 14:15:13111Majomházcpp17Wrong answer 0/10016ms7376 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>1)return 1;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1836 KiB
2Wrong answer3ms2252 KiB
subtask20/10
3Wrong answer3ms2348 KiB
4Wrong answer3ms2536 KiB
5Wrong answer3ms2552 KiB
6Wrong answer3ms3044 KiB
7Wrong answer2ms2912 KiB
subtask30/10
8Runtime error3ms3012 KiB
9Wrong answer3ms3392 KiB
10Wrong answer3ms3344 KiB
11Wrong answer2ms3240 KiB
12Runtime error3ms3328 KiB
subtask40/20
13Runtime error3ms3576 KiB
14Runtime error3ms3516 KiB
15Wrong answer3ms3512 KiB
16Wrong answer3ms3516 KiB
17Wrong answer3ms3520 KiB
18Runtime error3ms3516 KiB
subtask50/29
19Runtime error8ms4772 KiB
20Runtime error8ms4832 KiB
21Runtime error8ms5024 KiB
22Runtime error8ms4964 KiB
23Runtime error8ms5288 KiB
subtask60/31
24Runtime error14ms6844 KiB
25Wrong answer14ms6896 KiB
26Runtime error16ms7096 KiB
27Wrong answer14ms7148 KiB
28Runtime error14ms7052 KiB
29Runtime error16ms7252 KiB
30Wrong answer14ms7252 KiB
31Runtime error14ms7248 KiB
32Runtime error14ms7248 KiB
33Runtime error14ms7248 KiB
34Runtime error14ms7248 KiB
35Runtime error14ms7252 KiB
36Runtime error14ms7364 KiB
37Runtime error14ms7356 KiB
38Runtime error14ms7248 KiB
39Runtime error14ms7376 KiB
40Wrong answer16ms7344 KiB