| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1322246 | Trisanu_Das | Festival (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include "festival.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> max_coupons(int A, vector<int> P, vector<int> T){
int n; cin >> n;
vector<int> op(n);
iota(op.begin(), op.end(), 0);
sort(op.begin(), op.end() [&](int i, int j){
return T[i] * T[j] * (P[j] - P[i]) > P[j] * T[j] - P[i] * T[i];
});
vector<int> R;
for(int k = 0; k < n; k++){
int i = op[k];
if(A > P[i]){
R.push_back(i);
A = T[i] * (A - P[i]);
}else break;
}
return R;
}
