| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 217 | 43 | 26 | 19.403% |
Alice and Bob are famous magicians. Catherine, a wealthy woman who showed interest in their amazing deeds, declared that she would give them huge wealth if they could perform the following magic trick. The contents of the magic are as follows:
However, Alice and Bob don't think they are smart enough to successfully perform this magic trick, so they are seeking your help. Please write a program which implements Alice’s strategy and Bob’s strategy so that they can beat Catherine’s challenge.
You need to submit two files:
The first file is Alice.cpp, which implements Alice’s strategy. It should include Alice.h using the preprocessing directive #include. The function that needs to be implemented in the file is:
std::vector<std::pair<int, int>> Alice();
The function Alice() should call the following function exactly once:
long long setN(int n);
The second file is Bob.cpp, which implements Bob’s strategy. It should include Bob.h using the preprocessing directive #include. The function that needs to be implemented in the file is:
long long Bob(std::vector<std::pair<int, int>> V);
Alice().| Call | Return Value |
|---|---|
Alice() |
|
setN(4) |
3ドル$ |
| $\{\{1, 2\}, \{2, 3\}, \{2, 4\}\}$ | |
Bob({{1,2},{2,4}}) |
3ドル$ |
It represents the following scenario:
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 5 | $X ≤ 5,円 000$. |
| 2 | 30 | $X ≤ 25,円 000,円 000$. |
| 3 | 65 | No additional constraints. |
The sample grader reads the input in the following format:
if $T = 1,ドル then the sample grader reads as follows:
The sample grader prints your answer of function Alice() in the following format:
if $T = 2,ドル then The sample grader reads as follows:
The sample grader prints your answer of function Bob() in the following format:
Olympiad > Asia-Pacific Informatics Olympiad > APIO 2024 C번
C++17, C++20, C++17 (Clang), C++20 (Clang)