#include "ricehub.h"
#include<bits/stdc++.h>
int besthub(int R, int L, int X[], long long B)
{
int maxi= 0, c, a;
long long cp = B;
for(int i=1; i<=L; i++)
{
c = 0;
cp = B;
for(int j=0; j<R; j++)
{
a = abs(i-X[j]);
if(a<=cp)
{
cp-=a;
c++;
}
if(cp<=0)
{
break;
}
}
if(c>maxi)
{
maxi = c;
}
}
return maxi;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
3 |
Correct |
4 ms |
256 KB |
Output is correct |
4 |
Correct |
4 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
256 KB |
Output is correct |
9 |
Correct |
4 ms |
256 KB |
Output is correct |
10 |
Incorrect |
4 ms |
256 KB |
Output isn't correct |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
256 KB |
Output is correct |
2 |
Correct |
7 ms |
384 KB |
Output is correct |
3 |
Execution timed out |
1093 ms |
256 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1083 ms |
384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |