# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1252335 | NekoRolly | 축제 (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include "festival.h"
#include<bits/stdc++.h>
using namespace std;
struct coupon{
ll p,t,id;
};
bool comp(coupon A,coupon B){ // *{P[i], T[i]}
auto [p, a, ida] = A;
auto [q, b, idb] = B;
return a*b*p + b*q <= a*b*q + a*p;
}
vector<int> max_coupons(int A,vector<int> P,vector<int> T){
int n = P.size();
coupon a[n];
for (int i=0; i<P.size(); i++)
a[i] = {P[i], T[i], i};
sort(a, a+n, comp);
vector<int> vans;
for (int i=0; i<n; i++)
vans.push_back(a[i].id);
return vans;
}