Submission #531007

# Submission time Handle Problem Language Result Execution time Memory
531007 2022-02-27T10:17:13 Z Hanksburger Rice Hub (IOI11_ricehub) C++17
0 / 100
2 ms 460 KB
#include "ricehub.h"
#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 0 ms 204 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 2 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -