#include "ricehub.h"
#define LL long long
long long f(int x, int y, int *r){
return (LL)(r[y]-r[x])*(LL)(y-x+1)/(LL)2;
}
int besthub(int n, int max_L, int in[], long long B){
int x=0, y=0, out=0;
while(x<n){
while(y+1<n && f(x,y+1,in)<=B) y++;
out=out>y-x+1?out:y-x+1, x++;
} return out;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5020 KB |
Output is correct |
2 |
Incorrect |
0 ms |
5020 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
5020 KB |
Output is correct |
2 |
Correct |
0 ms |
5020 KB |
Output is correct |
3 |
Correct |
0 ms |
5020 KB |
Output is correct |
4 |
Incorrect |
0 ms |
5020 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
5020 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
5020 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |