| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365431 | activedeltorre | 축제 (IOI25_festival) | C++20 | 64 ms | 9276 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;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
