제출 #1365431

#제출 시각아이디문제언어결과실행 시간메모리
1365431activedeltorreFestival (IOI25_festival)C++20
32 / 100
64 ms9276 KiB
#include "festival.h"
#include <cassert>
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct ura
{
    long long first,second,index;
};
ura vec[200005];
long long spar[200005];
bool cmp(ura a,ura b)
{
    if(a.second==b.second)
    {
        return a.first<b.first;
    }
    if(a.first==0 || b.first==0)
    {
        return a.first<b.first;
    }
    long long val1=1ll*a.first*a.second*b.second+b.first*b.second;
    long long val2=1ll*b.first*b.second*a.second+a.first*a.second;
    return val1<val2;
}
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++)
    {
        vec[i].first=P[i];
        vec[i].second=T[i];
        vec[i].index=i;
    }
    sort(vec,vec+n,cmp);
    int val=A;
    vector<int>rasp;
    for(int i=0;i<n;i++)
    {
        if(vec[i].first<=val)
        {
            val=(val-vec[i].first)*vec[i].second;
            rasp.push_back(vec[i].index);
        }
    }
    return rasp;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…