Submission #973135

#TimeUsernameProblemLanguageResultExecution timeMemory
973135fzyzzz_zRice Hub (IOI11_ricehub)C++17
0 / 100
2 ms604 KiB
#include <bits/stdc++.h> using namespace std; #include "ricehub.h" using ll = long long; int besthub(int n, int L, int a[], long long k) { int l = 0, r = 0, ans = 1; ll c = 0; while (r < n) { if (c <= k) { ans = max(ans, r - l + 1); r++; if (r >= n) break; c += a[r] - a[(r + l) / 2]; } else { l++; c -= a[(r + l + 1) / 2] - a[l - 1]; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...