Submission #531006

# Submission time Handle Problem Language Result Execution time Memory
531006 2022-02-27T10:16:40 Z Hanksburger Rice Hub (IOI11_ricehub) C++17
0 / 100
4 ms 580 KB
#include <bits/stdc++.h>
using namespace std;
long long pref[100005];
int besthub(int n, int m, int a[], long long b)
{
	pref[0]=a[0];
	for (long long i=1; i<n; i++)
		pref[i]=pref[i-1]+a[i];
	long long ans=0;
	for (long long i=0; i<n; i++)
	{
		long long l=i, r=n-1;
		while (l<r)
		{
			long long mid=(l+r+1)/2;
			if (pref[mid]-pref[(l+mid)/2]-pref[(l+mid-1)/2]<=b)
				l=mid;
			else
				r=mid-1;
		}
		ans=max(ans, l-i+1);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 580 KB Output isn't correct
2 Halted 0 ms 0 KB -