제출 #118287

#제출 시각아이디문제언어결과실행 시간메모리
118287JustasZ선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define all(a) a.begin(), a.end() #define sz(a) (int)a.size() #define x first #define y second #define debug(...) cout << "[" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "]\n" #define rd() abs((int)rng()) using namespace std; using namespace __gnu_pbds; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long ll; typedef long double ld; typedef pair<int, int>pii; const int maxn = 1e5 + 100; const int mod = 1e9 + 7; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); ll delivery(int n, int k, int l, vector<int>pos) { if(k == 1) { ll ans = 0; for(int a : pos) ans += min(a, l - a); return ans; } }

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

boxes.cpp: In function 'll delivery(int, int, int, std::vector<int>)':
boxes.cpp:21:17: warning: unused parameter 'n' [-Wunused-parameter]
 ll delivery(int n, int k, int l, vector<int>pos)
                 ^
boxes.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/tmp/ccL4skxy.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status