#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
int besthub(int n, int m, int a[], long long x) {
int mx = 0, l = 1, r = 0;
int p[n+1];
p[0] = 0;
for (int i = 0; i < n; i++) p[i+1] = p[i] + a[i];
while (r < n) {
r++;
while (p[r] - p[(l + r + 1)/2 - (l - r) % 2] - p[(l + r - 1)/2] + p[l-1] > x) l++;
mx = max(mx, r - l + 1);
}
return mx;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
600 KB |
Output is correct |
2 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |