제출 #1253066

#제출 시각아이디문제언어결과실행 시간메모리
1253066QwertyPi축제 (IOI25_festival)C++20
컴파일 에러
0 ms0 KiB
#include "festival.h" #include <bits/stdc++.h> #define int long long using namespace std; const int MX = 2e14 + 11; struct coupon { int p, t, id; bool operator< (const coupon& o) const { return p < o.p; } }; vector<coupon> C[5]; vector<int> max_coupons(int A, vector<int> P, vector<int> T) { for (int i = 0; i < P.size(); i++) { C[T[i]].push_back({P[i], T[i], i}); } for (int t = 1; t <= 4; t++) { sort(C[t].begin(), C[t].end()); } vector<int> ans; for (auto c : C[1]) { if (A >= c.p) { A -= c.p; ans.push_back(c.id); } } return ans; }

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

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