| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1282732 | gabrielz | 축제 (IOI25_festival) | C++20 | 36 ms | 7140 KiB |
#include "festival.h"
#include <algorithm>
#include <tuple>
using Cu = std::tuple<int, int, int>; // price, type, org-idx
std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
std::vector<Cu> cu;
for (int i = 0; i < P.size(); ++i) {
cu.push_back(std::make_tuple(P[i], T[i], i));
}
std::sort(cu.begin(), cu.end(), [](const Cu& a, const Cu& b) {
return std::get<0>(a) < std::get<0>(b);
});
std::vector<int> R;
for (const auto& c : cu) {
if (A >= std::get<0>(c)) {
A = (A - std::get<0>(c) * std::get<1>(c));
R.push_back(std::get<2>(c));
} else {
break;
}
}
return R;
}
| # | 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... | ||||
