제출 #1016715

#제출 시각아이디문제언어결과실행 시간메모리
1016715tmarcinkevicius추월 (IOI23_overtaking)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int int64_t void init(int32_t _L, int32_t _N, vector<int> _T, vector<int32_t> _W, int32_t _X, int32_t _M, vector<int32_t> _S); long long arrival_time(long long Y); vector<vector<int>> Expected, Real; int32_t L; int32_t N; vector<int> T; vector<int32_t> W; int32_t X; int32_t M; vector<int32_t> S; void init(int32_t _L, int32_t _N, vector<int> _T, vector<int32_t> _W, int32_t _X, int32_t _M, vector<int32_t> _S) { _W.push_back(_X); L = _L; N = _N; T = _T; W = _W; X = _X; M = _M; S = _S; return; } long long arrival_time(long long Y) { Expected = vector<vector<int>>(N + 1); Real = vector<vector<int>>(N + 1); T.push_back(Y); for (int i = 0; i <= N; i++) { Expected[i] = vector<int>(M); Real[i] = vector<int>(M); Expected[i][0] = T[i]; Real[i][0] = T[i]; } for (int i = 1; i < M; i++) { int dis = S[i] - S[i - 1]; for (int j = 0; j <= N; j++) { Expected[j][i] = Real[j][i - 1] + dis * W[j]; } for (int j = 0; j <= N; j++) { Real[j][i] = Expected[j][i]; for (int z = 0; z <= N; z++) { if (z == j) continue; if (Real[z][i - 1] < Real[j][i - 1]) { Real[j][i] = max(Real[j][i], Expected[z][i]); } } } } /*for (int i = 0; i <= N; i++) { cout << "i = " << i << " "; for (int j = 0; j < M; j++) { cout << "|e: " << setw(4) << Expected[i][j] << ", r: " << setw(4) << Real[i][j] << "| "; } cout << '\n'; }*/ T.pop_back(); return Real[N][M - 1]; } /*int32_t main() { int _L, _N, _X, _M, _Q; cin >> _L >> _N >> _X >> _M >> _Q; vector<int> _T(_N); for (int i = 0; i < _N; i++) cin >> _T[i]; vector<int32_t> _W(_N); for (int i = 0; i < _N; i++) cin >> _W[i]; vector<int32_t> _S(_M); for (int i = 0; i < _M; i++) cin >> _S[i]; vector<int> _Y(_Q); for (int i = 0; i < _Q; i++) cin >> _Y[i]; init(_L, _N, _T, _W, _X, _M, _S); vector<int> res(_Q); for (int i = 0; i < _Q; i++) res[i] = arrival_time(_Y[i]); for (int i = 0; i < _Q; i++) cout << res[i] << '\n'; }*/

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

/usr/bin/ld: /tmp/ccm3qLy3.o: in function `main':
grader.cpp:(.text.startup+0x43e): undefined reference to `init(int, int, std::vector<long long, std::allocator<long long> >, std::vector<int, std::allocator<int> >, int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status