#P15586. [KTSC 2026] 五万酱汁 / 50,000 Sauces
[KTSC 2026] 五万酱汁 / 50,000 Sauces
Background
Submission notes:
- Do not include any header files.
- Add the following at the top of the file:
#include <vector> int query(std::vector<int>); - Submit using .
Problem Description
This is an interactive problem. In this problem, the interactive library is non-adaptive.
You are given a positive integer .
There is a hidden family of sets . Each element of is a subset of . Here, is or . Note that, by definition, a set cannot contain duplicate elements.
You may make the following queries multiple times, and your goal is to determine using as few queries as possible:
Query
Given with .
The interactive library returns .
Determine using as few queries as possible.
Implementation Details
This is a function-based interactive problem. You do not need to, and must not, implement the main function.
You should implement the following function:
int solve(int N)
- Return .
- This function is called exactly once.
You may call the following function:
int query(vector<int> Y)
- The elements in must be pairwise distinct.
- It must hold that .
- It must hold that .
- This function returns .
- In each test case, this function can be called at most times.
Your source code must not call any input/output functions.
Input Format
The input format of the sample grader program is as follows:
- Line :
- Line :
- For each :
- Line : ...
- are all distinct.
- is an element of the set family .
- Line : ...
Output Format
The sample grader program outputs the value returned by your code in the solve function and the number of calls to query in the following format:
- Line : the value returned by the
solvefunction - Line : the number of calls to
query,
6
2
2 0 1
3 2 3 4
2
3
Hint
Constraints
- .
- .
- For any , .
- The interactive library is non-adaptive. In other words, is fixed before
solveis called.
Subtasks
| ID | Score | Special Property | |
|---|---|---|---|
- Special property : For any two different , .
- Special property : For any , .
Scoring
In each subtask, if there is any case where the answer is incorrect, then this subtask gets points.
Otherwise, let be the maximum number of calls to query among all test cases in that subtask. The score is calculated by the following rules:
- For subtasks , if , you get full score.
- For subtasks :
- If , you get times the full score of the subtask.
- If , you get full score.
Example
, . .
The maximum size of a query set is .
The grader program initially calls the following function:
solve(6)
Your code may interact as follows:
query(0, 1, 2)
query(2, 3, 4)
query(0, 2, 3, 5)
- Since and ,
query(0, 1, 2)returns . - Since and ,
query(2, 3, 4)returns . - Since does not contain any element of ,
query(0, 2, 3, 5)returns .
Your code submits the answer by returning as the return value of solve(6).
Translated by ChatGPT 5