| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1321430 | thesentro | 축제 (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include "festival.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
ll n = P.size();
ll c = A;
vector<ll>v = P, h = T;
vector<pair<ll,ll>>vp;
for (int i=0 ; i<n ; i++)
{
vp.push_back({v[i], i});
}
sort(vp.begin(), vp.end());
vector<ll>ans;
for (auto i:vp)
{
if (c>=i.first)
{
c-=i.first;
ans.push_back(i.second);
}
}
return ans;
}
