Submission #974811

# Submission time Handle Problem Language Result Execution time Memory
974811 2024-05-03T20:17:27 Z marinaluca Boxes with souvenirs (IOI15_boxes) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC optimize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")

using namespace std;
#define int long long
#define ll long long
#define xx first
#define yy second
#define all (x) begin(x), end(x)
#define FOR (i, a, b) for (auto i = (a); i < (b); ++ i)

const int NMAX = 1e7;
int ans[NMAX + 1], rez[NMAX + 1]
int delivery (int n, int k, int l, int s[]){
    for (int i = 1; i <= n; ++ i){
        ans[i] = min (s[i - 1] * 2 , l);
        if (i > k){
            ans[i] += ans[i - k];
        }
    }
    int mini;
    for (int i = n - 1; i >= 0; -- i){
        rez[i] = min ((l - v[i]) * 2, l);
        if (i < n - k){
            rez[i] += rez[i + k];
        }
        mini = min (mini, rez[i] + ans[i]);
    }
    return mini;
}

Compilation message

boxes.cpp:7:13: error: expected initializer before 'long'
    7 | #define int long long
      |             ^~~~
boxes.cpp:16:1: note: in expansion of macro 'int'
   16 | int delivery (int n, int k, int l, int s[]){
      | ^~~