| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1322543 | jahinahnaf | 축제 (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include "festival.h"
#include <bits\stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T)
{
vector<int> Z;
vector<pair<int, int>> C;
for (int i = 0; i < P.size(); i++)
{
C.push_back({i, P[i]});
}
sort(all(C), [](const auto &a, const auto &b)
{ return a.second > b.second; });
int i = 0;
while (A > 0){
if (A - C[i].second >= 0){
A -= C[i].second;
Z.push_back(C[i].first);
}
i++;
}
return Z;
}
