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