# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1258127 | garam1732 | 축제 (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include "festival.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define bl ' '
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define comp(v) (v).erase(unique(all(v)), (v).end())
#define lbd(v,x) lower_bound(all(v), (x))-(v).begin()
#define ubd(v,x) upper_bound(all(v), (x))-(v).begin()
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<pi, int> pii;
typedef pair<int, pi> ipi;
typedef pair<pi, pi> pipi;
typedef pair<ll, ll> pll;
const int MAXN = 100100*2;
const ll MOD = 1e9+7;
const ll INF = 1e9+10;
struct Garam {
ll p, t, n;
bool operator < (const Garam& x) const {
if((t==1)^(x.t==1)) return x.t==1;
if(t==1) return p<x.p;
return p*t*(x.t-1) < x.p*x.t*(t-1);
}
} arr[MAXN];
vector<int> res;
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
int n = P.size();
for(int i=0; i<n; i++) arr[i] = {P[i],T[i], i};
sort(arr, arr+n);
for(int i=0;i<n;i++) res.push_back(arr[i].n);