Submission #467771

#TimeUsernameProblemLanguageResultExecution timeMemory
467771Carmel_Ab1Boxes with souvenirs (IOI15_boxes)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll>vl;
#include "boxes.h"
#define all(x) x.begin(),x.end()
#include "grader.cpp"
ll delivery(int N, int K, int L, int P[]) {
    ll n=N,k=K,l=L;
    vl p(n);
    for(int i=0; i<n; i++)
        p[i]=P[i];

    ll ans=1e18;
    ans=l;
    for(int i=0; i<n-1; i++)
        ans=min(ans,2*p[i]+2*p[i+1]);
    return ans;
    for(int i=0; i<n ;i++){
        ll cur=0,has=0,sum=0;
        for(int j=0; j<=i; j++) {
            if((j+1)%k==0 || j==i)
                sum+=2*p[j];
        }

        has=0;
        for(int j=n-1; j>i; j--){
            has++;
            if(has%k==0 || j==i+1)
                sum+=2*(l-p[j]);
        }
        ans=min(ans,sum);
    }

    for(int i=0; i<n; i++){
        ll cur=0,has=0,sum=0;
        for(int j=0; j<=i; j++) {
            has++;
            if(has%k==0 || j==i)
                sum+=2*p[j];
        }
        while(has%k)
            has++;

        sum+=l;
        int hass=0;
        for(int j=n-1; j>has; j--){
            hass++;
            if(hass%k==0 || j==has+1)
                sum+=2*(l-p[j]);
        }
        ans=min(ans,sum);

    }
    return ans;
}

Compilation message (stderr)

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