답안 #28813

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
28813 2017-07-17T08:54:55 Z dereotu 쌀 창고 (IOI11_ricehub) C++14
42 / 100
1000 ms 5964 KB
#include "ricehub.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define forr(i,A,B) for(int i=A;i<B;++i)
#define space ' '
#define endl '\n'
#define LL long long
using namespace std;

int a[10005],ans;

int besthub(int R, int L, int X[], long long B){
	
	forr(i,0,L){
		int b=0,h=0;
		memset(a,0,sizeof a);
		forr(j,0,R){
			a[j]=abs(X[j]-i);
		}
		sort(a,a+R);
		forr(j,0,R){
			if(b+a[j]<=B){
				b+=a[j];
				h++;
			}
			else break;
		}
		ans=max(ans,h);
	}
 	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5964 KB Output is correct
2 Correct 0 ms 5964 KB Output is correct
3 Correct 0 ms 5964 KB Output is correct
4 Correct 0 ms 5964 KB Output is correct
5 Correct 0 ms 5964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 5964 KB Output is correct
2 Correct 0 ms 5964 KB Output is correct
3 Correct 0 ms 5964 KB Output is correct
4 Correct 0 ms 5964 KB Output is correct
5 Correct 3 ms 5964 KB Output is correct
6 Correct 3 ms 5964 KB Output is correct
7 Correct 3 ms 5964 KB Output is correct
8 Correct 3 ms 5964 KB Output is correct
9 Correct 0 ms 5964 KB Output is correct
10 Correct 0 ms 5964 KB Output is correct
11 Correct 0 ms 5964 KB Output is correct
12 Correct 0 ms 5964 KB Output is correct
13 Correct 0 ms 5964 KB Output is correct
14 Correct 0 ms 5964 KB Output is correct
15 Correct 3 ms 5964 KB Output is correct
16 Correct 3 ms 5964 KB Output is correct
17 Correct 0 ms 5964 KB Output is correct
18 Correct 0 ms 5964 KB Output is correct
19 Correct 3 ms 5964 KB Output is correct
20 Correct 3 ms 5964 KB Output is correct
21 Correct 6 ms 5964 KB Output is correct
22 Correct 6 ms 5964 KB Output is correct
23 Correct 129 ms 5964 KB Output is correct
24 Correct 116 ms 5964 KB Output is correct
25 Correct 113 ms 5964 KB Output is correct
26 Correct 113 ms 5964 KB Output is correct
27 Correct 99 ms 5964 KB Output is correct
28 Correct 96 ms 5964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 5964 KB Output is correct
2 Correct 36 ms 5964 KB Output is correct
3 Execution timed out 1000 ms 5964 KB Execution timed out
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 5964 KB Execution timed out
2 Halted 0 ms 0 KB -