//#include "souvenirs.h"
#include <bits/stdc++.h>
#define task "TEST"
#define task2 "A"
#define pl pair<ll, ll>
#define pf push_front
#define pb push_back
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b, c) for (int i=a; i<=b; i+=c)
#define FORE(i, a, b, c) for (int i=a; i>=b; i+=c)
using namespace std;
using ll = long long;
using Knowledge = pair<vector<int>, ll>;
using ull = unsigned long long;
const int Mod = 998244353;
const int maxn = 3e5;
const ll Inf = 1e16;
ll n, a, s;
vector<int> P, T;
struct Coupon {
ll p, num;
ll pos;
bool operator > (Coupon other) const {
return p*num*other.num + other.p*other.num <
other.p*other.num*num + p*num;
};
};
vector<Coupon> C[5];
ll Fix(ll& i, ll& j, ll& k, ll& h, ll pos, ll add) {
ll v;
if (pos == 1) i += add, v = i;
if (pos == 2) j += add, v = j;
if (pos == 3) k += add, v = k;
if (pos == 4) h += add, v = h;
return v;
}
vector<int> max_coupons(int s, vector<int> P, vector<int> T) {
vector<Coupon> S; vector<int> res;
FOR(i, 0, P.size()-1, 1) S.pb({P[i], T[i], i});
sort(S.begin(), S.end(), greater<Coupon>());
FOR(i, 0, P.size()-1, 1) res.pb(S[i].pos);
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |