# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
302644 | errorgorn | 쌀 창고 (IOI11_ricehub) | C++17 | 20 ms | 1792 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
int besthub(int n, int L, int arr[], long long k){
int m=0,r=-1;
ll curr=0;
int ans=0;
rep(l,0,n){
if (m<l+r>>1){
curr-=(arr[m+1]-arr[m])*((r-m)-(m-l+1));
m++;
}
//cout<<l<<" "<<m<<" "<<r<<" "<<curr<<endl;
while (curr<=k){
ans=max(ans,r-l+1);
if (r==n-1) break;
r++;
curr+=arr[r]-arr[m];
if (m<l+r>>1){
curr-=(arr[m+1]-arr[m])*((r-m)-(m-l+1));
m++;
}
}
curr-=arr[m]-arr[l];
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |