| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337802 | playeragp | Souvenirs (IOI25_souvenirs) | C++20 | 13 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<long long> prices;
int totalTypes;
pair<vector<int>, long long> transaction(long long M);
void determinePrice(int index) {
long long left = 1;
long long right = prices[0];
while (left < right) {
long long mid = (left + right) / 2;
auto result = transaction(mid);
bool foundHigher = false;
for (int type : result.first) {
if (type < index) {
foundHigher = true;
break;
}
}
if (foundHigher || result.first.empty()) {
left = mid + 1;
} else {
right = mid;
}
}
prices[index] = left;
}
void buy_souvenirs(int N, long long P0) {
totalTypes = N;
prices.resize(N);
prices[0] = P0;
for (int i = 1; i < N; i++) {
determinePrice(i);
}
vector<int> counts(N, 0);
for (int i = 1; i < N; i++) {
while (counts[i] < i) {
auto result = transaction(prices[i]);
for (int type : result.first) {
counts[type]++;
}
}
}
}| # | 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... | ||||
