Submission #88009

# Submission time Handle Problem Language Result Execution time Memory
88009 2018-12-03T11:19:27 Z Pajaraja Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int n,l;
long long b,x[100007];
bool provera(int k)
{
	int poc=0,krj=k,med=k/2;
	long long spr=0,spo=0;
	for(int i=0;i<med;i++) spr+=x[i];
	for(int i=med+1;i<krj;i++) spo+=x[i];  
	while(krj<=n)
	{
		long long sum=spo-spr+(k%2==0?x[med]:0);
		if(sum<=b) return true;
		spr-=x[poc];
		spo+=x[krj];
		spr+=x[med];
		poc++;
		krj++;
		med++;
		spo-=x[med];
	}
	return false;
}
int binarna(int l,int r)
{
	if(l==r) return l;
	int s=(l+r+1)/2;
	if(provera(s)) return binarna(s,r);
	return binarna(l,s-1);
}
int besthub(int R, int L, int X[], long long B)
{
	n=R;
	l=L;
	for(int i=0;i<n;i++) x[i]=X[i];
	b=B;
    return binarna(1,n);
}

Compilation message

ricehub.cpp:1:10: fatal error: grader.h: No such file or directory
 #include "grader.h"
          ^~~~~~~~~~
compilation terminated.