| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327848 | arman.khachatryan | Rice Hub (IOI11_ricehub) | C++20 | 8 ms | 1444 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, ans=1;
long long cur;
for(int i=1; i<r; i++){
if(j>=i){
continue;
}
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++;
i--;
}else{
ans=max(i-j+1, ans);
}
}
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... | ||||
