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;
auto recal = [&](){
long long sum = 0;
int ll = l, rr = r;
while (ll < rr) sum += a[rr--] + a[ll++];
return sum;
};
while (r < n) {
r++;
while (recal() > 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... |