| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337801 | playeragp | 선물 (IOI25_souvenirs) | C++20 | 1 ms | 412 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 = prices[index - 1] - 1;
long long right = prices[index - 1];
while (left + 1 < right) {
long long mid = (left + right) / 2;
auto result = transaction(mid);
if (result.first.empty() || result.first[0] < index) {
left = mid;
} else {
right = mid;
}
}
prices[index] = right;
}
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);
}
for (int i = 1; i < N; i++) {
for (int j = 0; j < i; j++) {
transaction(prices[i]);
}
}
}| # | 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... | ||||
