제출 #1260515

#제출 시각아이디문제언어결과실행 시간메모리
1260515yhx3축제 (IOI25_festival)C++20
0 / 100
57 ms8356 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ord_set tree < int ,  null_type ,  less ,  rb_tree_tag ,  tree_order_statistics_node_update>
#define ll long long
#define rep(i,a,b) for (int i = a; i < b; i++)
#define rrep(i,a,b) for (int i = a; i >= b; i--)
void N() {cout<<"NO\n";}
void Y() {cout<<"YES\n";}
void isTrue(bool ope) {
    if (ope) Y();else N();
}
int MD = 1e9+7;
ll MX_VL = 1e18;
int MX_ll = 2e9;

ll a;
vector<pair<int,int>> pV;
vector<pair<int,int>> tV;

bool comp(int &x,int& y) {
    return (a-pV[x].first) > (a-pV[y].first);
}

vector<int> max_coupons(int A,vector<int> P, vector<int> T) {
    a = A;
    rep(i,0,P.size()) {
        pV.push_back(make_pair(P[i],i));
        tV.push_back(make_pair(T[i],i));
    }
    vector<int> lst;
    rep(i,0,P.size()) lst.push_back(i);
    vector<int> ans;
    sort(lst.begin(),lst.end(),comp);
    while (!lst.empty()) {
        int i = lst[0];
        if (a < P[i]) break;
        a = (a-P[i])*T[i];
        ans.push_back(i);
    }
    return ans;
    while (!lst.empty()) {
        if (a > 7*1e10) {
            for (auto v:lst) ans.push_back(v);
            break;
        }
        lst.erase(lst.begin());
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...