제출 #530697

#제출 시각아이디문제언어결과실행 시간메모리
530697CyanmondRoller Coaster Railroad (IOI16_railroad)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> template <typename T> using Vec = std::vector<T>; std::vector<int> find_subset(int L, int R, std::vector<int> W) { const int N = (int)W.size(); Vec<Vec<int>> dp(N + 1, std::vector<int>(R + 1, -1)); dp[0][0] = 0; for (int i = 0; i < N; ++i) { for (int j = 0; j <= R; ++j) { if (dp[i][j] == -1) continue; dp[i + 1][j] = dp[i][j]; if (j + W[i] <= R) dp[i + 1][j + W[i]] = i; } } for (int answer_w = L; answer_w <= R; ++answer_w) { if (dp[N][answer_w] == -1) continue; Vec<int> answer; int now = answer_w, now_id = N; while (now != 0) { const int new_id = dp[now_id][now]; answer.push_back(new_id); now -= W[new_id]; now_id = new_id; } return answer; } return {}; }

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

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