Submission #1084926

#TimeUsernameProblemLanguageResultExecution timeMemory
1084926PakinDioxideRice Hub (IOI11_ricehub)C++17
0 / 100
2 ms604 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 = 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...