제출 #1132698

#제출 시각아이디문제언어결과실행 시간메모리
1132698SpyrosAlivLongest Trip (IOI23_longesttrip)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long bool are_connected(vector<int> a, vector<int> b); vector<int> longest_trip(int n, int d) { if (d == 3) { vector<int> ans; for (int i = 0; i < n; i++) ans.push_back(i); return ans; } else if (d == 2) { vector<int> ans; ans.push_back(0); for (int i = 0; i < n-1; i++) { bool x = are_connected({i}, {i+1}); if (x) { ans.push_back(i+1); continue; } else { ans.push_back(i+2); ans.push_back(i+1); i++; } } } return {}; }

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

/usr/bin/ld: /tmp/ccHGm4uR.o: in function `longest_trip(long long, long long)':
longesttrip.cpp:(.text+0x1e6): undefined reference to `are_connected(std::vector<long long, std::allocator<long long> >, std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: /tmp/cc2j3xhi.o: in function `main':
stub.cpp:(.text.startup+0xa8): undefined reference to `longest_trip(int, int)'
collect2: error: ld returned 1 exit status