Submission #430824

#TimeUsernameProblemLanguageResultExecution timeMemory
430824Emin2004Boxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define endl '\n' #define pii pair <int, int> #define pb push_back #define F first #define S second #define ll long long #define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define M_PI 3.14159265358979323846 const int N = 200005; const int mod = 1e9 + 7; long long delivery(ll n, int k, ll l, ll p[]) { if(k == 1){ ll ans = 0; for(int i = 0; i < n; i++){ ans += min(p[i], l - p[i]); } return ans * 2; } if(k == n){ ll ans = LONG_MAX; for(int i = 1; i < n; i++){ ll cur = (p[i - 1] + (n - p[i])); ans = min(ans, cur); } return ans * 2; } }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(long long int, int, long long int, long long int*)':
boxes.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
/usr/bin/ld: /tmp/ccYSBJQR.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status