# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
830028 | OAleksa | 쌀 창고 (IOI11_ricehub) | C++14 | 1085 ms | 660 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "ricehub.h"
#define f first
#define s second
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
int n = R;
int a[n];
for(int i = 0;i < n;i++)
a[i] = X[i];
int ans = 0;
for(int i = 0;i < n;i++) {
multiset<int> st;
for(int j = i;j >= 0;j--) {
if(a[i] - a[j] > B)
break;
st.insert(abs(a[j] - a[i]));
}
for(int j = i + 1;j < n;j++) {
if(a[j] - a[i] > B)
break;
st.insert(abs(a[j] - a[i]));
}
int res = 0;
long long t = 0;
for(auto x : st) {
if(t + x <= B) {
t += x;
# | 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... |