제출 #402312

#제출 시각아이디문제언어결과실행 시간메모리
402312rainboy쌀 창고 (IOI11_ricehub)C11
100 / 100
19 ms1736 KiB
#include "ricehub.h"

int max(int a, int b) { return a > b ? a : b; }

int besthub(int n, int L, int *xx, long long d) {
	int i, j, k;

	k = 0;
	for (i = 0, j = 0; j < n; j++) {
		d -= xx[j] - xx[(i + j) / 2];
		while (d < 0)
			d += xx[(i + 1 + j) / 2] - xx[i], i++;
		k = max(k, j - i + 1);
	}
	return k;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...