# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1003378 | vjudge1 | 쌀 창고 (IOI11_ricehub) | C++17 | 1006 ms | 2004 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "ricehub.h"
#define ll long long
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define f first
#define s second
#define pb push_back
#define p_b pop_back
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
ll n = R, i;
ll h[n+5], pref[n+5];
pref[0] = 0;
for(i = 1; i <= n; i++)
h[i] = X[i-1];
h[0] = X[0];
for(i = 1; i <= n; i++)
pref[i] = pref[i-1] + h[i];
ll res = 0;
for(i = 1; i <= n; i++)
{
vector<pll>vect;
ll minn = LLONG_MAX, maxx = LLONG_MIN;
for(ll j = 1; j <= n; j++)
vect.pb({abs(h[i] - h[j]), j});
ll sum = 0;
for(ll j = 0; j < vect.size(); j++)
{
if(sum + vect[j].f <= B)
{
sum += vect[j].f;
minn = min(minn, vect[j].s);
maxx = max(maxx, vect[j].s);
}
}
res = max(res, minn - maxx + 1);
}
return res;
}
컴파일 시 표준 에러 (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... |