제출 #460565

#제출 시각아이디문제언어결과실행 시간메모리
460565fuad27쌀 창고 (IOI11_ricehub)C++14
0 / 100
3 ms332 KiB
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
int besthub(int R, int L, int x[], long long B) {
	int MAX = 0;
	for(int i = 0, j = 0;j<R;j++) {
		long long c = x[j] - x[(i + j)/2];
		while(c > B) {
			 c -= x[(i + 1 + j)/2] - x[i];
			 i++;
		}
		MAX = max(MAX, j-i+1);
	}
	return MAX;
}
/*int main () {
	int X[5] = {1, 2, 10, 12, 14};
	cout<<besthub(5, 20, X, 6);			
}
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...