Submission #133053

# Submission time Handle Problem Language Result Execution time Memory
133053 2019-07-20T06:05:24 Z ckodser Boxes with souvenirs (IOI15_boxes) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include<bits/stdc++.h>

#define ll long long
#define F first
#define S Second
#define pb push_back
#define pii pair<ll,ll>
#define mp make_pair

using namespace :: std;

const ll maxn=1e7+500;
const ll inf=1e17+900;

ll sagh(ll n,ll k){return (n/k)+(n%k!=0);}

ll dp[maxn];
ll r[maxn];
ll l[maxn];

long long delivery(int n, int k, int L, int p[]) {
    fill(dp,dp+maxn,inf);
    ll u=n%k;
    for(ll i=0;i<=u;i++){
	vector<ll> vec;
	for(ll j=i+k;j<n;j+=k){
	    l[j/k]=2*p[j];
	    vec.pb(l[j/k]);
	}
	ll ii=u-i;
	ll cnt=1;
	for(ll j=n-ii-k;j>=0;j-=k){
	    r[cnt++]=2*(L-p[j]);
	    vec.pb(r[cnt-1]);
	}
	ll ct=0;
	if(i)ct+=2*p[i-1];
	if(ii)ct+=2*(L-p[n-ii]);


	sort(vec.begin(),vec.end());
	ll pr=0;
	for(ll j=0;j<vec.size();j++){
	    dp[j*k+u]=min(dp[j*k+u],ct+pr);
	    pr+=vec[j];
	}
	dp[vec.size()*k+u]=min(dp[vec.size()*k+u],ct+pr);
    }




    ll ans=sagh(n,k)*L;
    for(ll i=0;i*k<=n;i++){
	ans=min(ans,dp[n-i*k]+L*i);
    }
    return ans;
}

Compilation message

boxes.cpp:1:10: fatal error: grader.h: No such file or directory
 #include "grader.h"
          ^~~~~~~~~~
compilation terminated.