# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
551662 |
2022-04-21T09:29:02 Z |
ala2 |
Rice Hub (IOI11_ricehub) |
C++14 |
|
1000 ms |
340 KB |
#include "ricehub.h"
#include <iostream>
using namespace std;
int n,d;
int a[1000100];
int f(int i,int j)
{
int x=(i+j)/2;
x=a[x];
int g=0;
for(int o=i;o<=j;o++)
g+=abs(a[o]-x);
return g;
}
int besthub(int R, int L, int X[], long long B)
{
n=R;
d=L;
for(int i=0;i<n;i++)
a[i]=X[i];
int mx=1;
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
if(f(i,j)<=B)
mx=max(mx,j-i+1);
}
}
int ann=mx;
//cout<<mx<<endl;
return ann;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
308 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
320 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
308 KB |
Output is correct |
17 |
Correct |
1 ms |
308 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
304 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
18 ms |
212 KB |
Output is correct |
22 |
Correct |
18 ms |
308 KB |
Output is correct |
23 |
Correct |
17 ms |
312 KB |
Output is correct |
24 |
Correct |
18 ms |
312 KB |
Output is correct |
25 |
Correct |
18 ms |
212 KB |
Output is correct |
26 |
Correct |
18 ms |
316 KB |
Output is correct |
27 |
Correct |
17 ms |
212 KB |
Output is correct |
28 |
Correct |
19 ms |
320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
308 KB |
Output is correct |
3 |
Correct |
103 ms |
304 KB |
Output is correct |
4 |
Correct |
102 ms |
300 KB |
Output is correct |
5 |
Correct |
18 ms |
340 KB |
Output is correct |
6 |
Correct |
20 ms |
212 KB |
Output is correct |
7 |
Correct |
134 ms |
212 KB |
Output is correct |
8 |
Correct |
132 ms |
312 KB |
Output is correct |
9 |
Correct |
18 ms |
212 KB |
Output is correct |
10 |
Correct |
18 ms |
320 KB |
Output is correct |
11 |
Correct |
77 ms |
300 KB |
Output is correct |
12 |
Correct |
70 ms |
312 KB |
Output is correct |
13 |
Correct |
139 ms |
308 KB |
Output is correct |
14 |
Correct |
151 ms |
316 KB |
Output is correct |
15 |
Correct |
19 ms |
320 KB |
Output is correct |
16 |
Correct |
18 ms |
212 KB |
Output is correct |
17 |
Correct |
70 ms |
300 KB |
Output is correct |
18 |
Correct |
71 ms |
340 KB |
Output is correct |
19 |
Correct |
135 ms |
304 KB |
Output is correct |
20 |
Correct |
137 ms |
212 KB |
Output is correct |
21 |
Execution timed out |
1092 ms |
340 KB |
Time limit exceeded |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1098 ms |
340 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |