This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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] - 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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |