제출 #364059

#제출 시각아이디문제언어결과실행 시간메모리
364059knightron0선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fr first #define sc second #define clr(a, x) memset(a, x, sizeof(a)) #define dbg(x) cout<<"("<<#x<<"): "<<x<<endl; #define printvector(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout<<*it<<" "; cout<<endl; #define all(v) v.begin(), v.end() #define lcm(a, b) (a * b)/__gcd(a, b) #define int long long int #define printvecpairs(vec) for(auto it: vec) cout<<it.fr<<' '<<it.sc<<endl; #define endl '\n' #define float long double const int MOD = 1e9 + 7; const int INF = 2e15; const int MAXN = 1e5 + 5; int delivery(int N, int k, int l, int positions[]) { int sum = 0; for(int i= 0;i<N;i++){ int x = min(abs(l-positions[i]), positions[i]); sum += x*2; } return sum; } // signed main() { // ios_base::sync_with_stdio(false); // cin.tie(NULL); // #ifdef LOCAL // freopen("input.txt", "r", stdin); // #endif // int n, k, l; // cin>>n>>k>>l; // int pos[n]; // for(int i= 0;i<n;i++){ // cin>>pos[i]; // } // cout<<delivery(n, k, l, pos)<<endl; // return 0; // }

컴파일 시 표준 에러 (stderr) 메시지

boxes.cpp: In function 'long long int delivery(long long int, long long int, long long int, long long int*)':
boxes.cpp:22:25: warning: unused parameter 'k' [-Wunused-parameter]
   22 | int delivery(int N, int k, int l, int positions[]) {
      |                         ^
/tmp/ccGFVJdK.o: In function `main':
grader.c:(.text.startup+0x1cb): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status