제출 #1282075

#제출 시각아이디문제언어결과실행 시간메모리
1282075lukasuliashvili축제 (IOI25_festival)C++20
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; long long S; cin >> N >> S; vector<long long> prices(N); for (int i = 0; i < N; ++i) { int t; cin >> t >> prices[i]; } sort(prices.begin(), prices.end()); int count = 0; for (int i = 0; i < N; ++i) { if (S >= prices[i]) { S -= prices[i]; ++count; } else { break; } } cout << count << endl; return 0; }

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

/usr/bin/ld: /tmp/ccxIzPZh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccY74UAV.o:festival.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccxIzPZh.o: in function `main':
grader.cpp:(.text.startup+0x22a): 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