# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1269308 | sula2 | Festival (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
int N = P.size();
vector<int> ind(N);
iota(all(ind), 0);
sort(all(ind), [&](int i, int j) {
long long x = 1LL*-P[i]*T[i]*T[j] - 1LL*P[j]*T[j];
long long y = 1LL*-P[j]*T[j]*T[i] - 1LL*P[i]*T[i];
return x > y;
});
return ind;
}