Submission #516229

#TimeUsernameProblemLanguageResultExecution timeMemory
516229MohamedAliSaidaneBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "boxes.h" using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ld,ld> pld; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpi; typedef vector<pll> vpl; #define pb push_back #define popb pop_back #define all(v) (v).begin(),(v).end() #define ff first #define ss second const ll INF= 1e18 ; const ll MOD = 1e9 + 7; int n, k, l; vi A; ll delivery(int N, int K, int L, vi positions) { n = N, k = K, l = L; A = positions; ll ans = 0ll; ll maxt = 0ll; for(auto e: positions) { ans += (ll)(min(e,l-e)); } return 2ll*ans; } /* int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int N, K, L; vi positions; cin >> N >> K >> L; for(int i = 0; i <N; i ++) { int x; cin >> x; positions.pb(x); } cout << delivery(N,K,L,positions); }*/

Compilation message (stderr)

boxes.cpp: In function 'll delivery(int, int, int, vi)':
boxes.cpp:34:8: warning: unused variable 'maxt' [-Wunused-variable]
   34 |     ll maxt = 0ll;
      |        ^~~~
/usr/bin/ld: /tmp/ccema6oP.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status