# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
953906 |
2024-03-26T21:17:11 Z |
4QT0R |
Rice Hub (IOI11_ricehub) |
C++17 |
|
2 ms |
2648 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll pref[100003];
ll pos[100003];
ll cost(ll l, ll p){
ll med=(l+p)/2;
return pref[p]-2*pref[med]+pos[l-1]+(!((l+p)&1))*pos[med];
}
ll besthub(int n, int L, int x[], ll bud){
for (ll i = 0; i<n; i++){
pos[i+1]=x[i];
pref[i+1]=pref[i]+x[i];
}
ll mx=1,p=1;
for (ll l = 1; l<=n; l++){
while(p<n && cost(l,p+1)<=bud)p++;
mx=max(mx,p-l+1);
}
return mx;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2648 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |