Submission #28809

# Submission time Handle Problem Language Result Execution time Memory
28809 2017-07-17T08:43:31 Z dereotu Rice Hub (IOI11_ricehub) C++14
17 / 100
1000 ms 5924 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[105],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;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 5924 KB Output is correct
2 Correct 0 ms 5924 KB Output is correct
3 Correct 0 ms 5924 KB Output is correct
4 Correct 0 ms 5924 KB Output is correct
5 Correct 0 ms 5924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 5924 KB Output is correct
2 Correct 0 ms 5924 KB Output is correct
3 Correct 0 ms 5924 KB Output is correct
4 Correct 0 ms 5924 KB Output is correct
5 Correct 0 ms 5924 KB Output is correct
6 Correct 0 ms 5924 KB Output is correct
7 Correct 0 ms 5924 KB Output is correct
8 Correct 0 ms 5924 KB Output is correct
9 Correct 0 ms 5924 KB Output is correct
10 Correct 0 ms 5924 KB Output is correct
11 Correct 0 ms 5924 KB Output is correct
12 Correct 0 ms 5924 KB Output is correct
13 Correct 0 ms 5924 KB Output is correct
14 Correct 0 ms 5924 KB Output is correct
15 Correct 0 ms 5924 KB Output is correct
16 Correct 0 ms 5924 KB Output is correct
17 Correct 0 ms 5924 KB Output is correct
18 Correct 0 ms 5924 KB Output is correct
19 Correct 0 ms 5924 KB Output is correct
20 Correct 0 ms 5924 KB Output is correct
21 Incorrect 3 ms 5924 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 5924 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 5924 KB Execution timed out
2 Halted 0 ms 0 KB -