Submission #1084922

#TimeUsernameProblemLanguageResultExecution timeMemory
1084922PakinDioxideRice Hub (IOI11_ricehub)C++17
68 / 100
1045 ms1880 KiB
#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 = 0, r = -1; auto recal = [&]() { long long sum = 0; int ll = l, rr = r; while (ll < rr) sum += a[rr--] - a[ll++]; return sum; }; while (r < n-1) { r++; while (recal() > x) l++; mx = max(mx, r - l + 1); } return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...