답안 #922140

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
922140 2024-02-05T06:48:05 Z tamir1 쌀 창고 (IOI11_ricehub) C++14
100 / 100
13 ms 2140 KB
#include "ricehub.h"
#include <iostream>
#define ll long long
using namespace std;
ll ans,cur,i,sz,med,fi;
int besthub(int R, int L, int X[], long long B)
{
	fi=-1;
	sz=1;
	for(i=1;i<R;i++){
		sz++;
		if(sz%2==1){
			cur+=(X[i]-X[med]);
		}
		else{
			cur+=(X[med+1]-X[med]);
			med++;
			cur+=(X[i]-X[med]);
		}
		while(cur>B){
			sz--;
			fi++;
			if(sz%2==1){
				cur-=(X[med]-X[fi]);
			}
			else{
				cur+=(X[med+1]-X[med]);
				med++;
				cur-=(X[med]-X[fi]);
			}
		}
		ans=max(ans,sz);
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 448 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 2 ms 572 KB Output is correct
3 Correct 9 ms 1884 KB Output is correct
4 Correct 13 ms 2140 KB Output is correct
5 Correct 4 ms 860 KB Output is correct
6 Correct 5 ms 968 KB Output is correct
7 Correct 9 ms 1508 KB Output is correct
8 Correct 8 ms 1584 KB Output is correct
9 Correct 5 ms 856 KB Output is correct
10 Correct 4 ms 860 KB Output is correct
11 Correct 10 ms 1840 KB Output is correct
12 Correct 9 ms 1884 KB Output is correct
13 Correct 5 ms 820 KB Output is correct
14 Correct 4 ms 860 KB Output is correct
15 Correct 7 ms 1520 KB Output is correct
16 Correct 12 ms 1372 KB Output is correct
17 Correct 8 ms 1624 KB Output is correct
18 Correct 8 ms 1592 KB Output is correct
19 Correct 10 ms 1628 KB Output is correct
20 Correct 12 ms 1628 KB Output is correct