# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425250 | chirathnirodha | Rice Hub (IOI11_ricehub) | C++17 | 23 ms | 1752 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Coded by Chirath Nirodha
#include<bits/stdc++.h>
#include "ricehub.h"
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define P push
#define I insert
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll mod=1e9+7;
int besthub(int R, int L, int X[], long long B){
int n=R;
ll ans=1;
ll l=0,r=0,cur=0;
while(l<n && r<n){
if(cur<=B){
if(r==n-1)break;
int m=(l+r+1)/2;
cur+=(long long) X[r+1]-(long long) X[m];
r++;
}
else{
if(l==n-1)break;
int m=(l+r+1)/2;
cur-=(long long) X[m]-(long long) X[l];
# | 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... |