| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 125571 | baluteshih | 선물상자 (IOI15_boxes) | C++14 | 2078 ms | 29752 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include <bits/stdc++.h>
#define pb push_back
#define MP make_pair
#define F first
#define S second
#define MEM(i,j) memset(i,j,sizeof i)
#define ALL(v) v.begin(),v.end()
#define ET cout << "\n"
#define DB(a,s,e) {for(int i=s;i<e;++i) cout << a[i] << " ";ET;}
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF=1e18;
vector<ll> lf,rg;
ll dp[2][10000005];
long long delivery(int N, int K, int L, int p[])
{
int bound=L/2;
ll ans=INF,lsz,rsz;
lf.pb(0);
for(int i=0;i<N;++i)
if(p[i]<=bound) lf.pb(p[i]);
else rg.pb(p[i]);
rg.pb(L),reverse(ALL(rg));
for(int i=0;i<rg.size();++i)
rg[i]=L-rg[i];
for(int i=0;i<lf.size();++i)
if(i>=K) dp[0][i]=dp[0][i-K]+lf[i]*2;
else dp[0][i]=lf[i]*2;
for(int i=0;i<rg.size();++i)
if(i>=K) dp[1][i]=dp[1][i-K]+rg[i]*2;
else dp[1][i]=rg[i]*2;
lsz=lf.size(),rsz=rg.size();
for(int i=0;i<rg.size();++i)
for(ll j=0;lsz-j*K+rsz-i-2>=0;++j)
if(rsz-i-1<=j*K)
ans=min(ans,dp[1][i]+j*L+dp[0][lsz-j*K+rsz-i-2]);
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
