| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327852 | arman.khachatryan | Rice Hub (IOI11_ricehub) | C++20 | 8 ms | 1336 KiB |
#include <bits/stdc++.h>
using namespace std;
long long besthub(int r, int l, int* a, long long b){
long long pref[r+1];
pref[0]=0;
pref[1]=a[0];
for(int i=2; i<=r; i++){
pref[i]=pref[i-1]+a[i-1];
}
int j=0;
long long cur, ans=1;
for(int i=0; i<r; i++){
while(j<=i){
int mid=(i+j)/2;
cur=(mid-j)*a[mid]-(pref[mid]-pref[j]);
cur+=pref[i+1]-pref[mid+1]-(i-mid)*a[mid];
if(cur>b){
j++;
}else{
ans=max((i-j+1)*1LL, ans);
break;
}
}
}
return ans;
}| # | 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... | ||||
