luogu#P8052. [ZYOI Round1] Truth/真心话大冒险
[ZYOI Round1] Truth/真心话大冒险
Background
Note: Please do not submit code maliciously and waste judging resources.
A group of people are at a party, playing “Truth or Dare”.
Problem Description
Charlie is now targeting someone named Percy. They plan to determine Percy’s ranking of favorability toward people of the opposite sex.
Specifically, Charlie can make two types of requests:
-
[Truth] Given positive integers , Percy must answer the ID of the person he likes the second most among these three. Constraints: .
-
[Dare] Given positive integers , Percy must hug the one he likes more between them. Constraints: , and it is guaranteed that among , at least one is Percy’s favorite overall.
Charlie wants to achieve his goal using at most queries.
Interactive format:
At the beginning, read one positive integer to start the interaction.
You may output three types of messages:
1 x y z, which represents a “Truth” query, then read the result.2 x y, which represents a “Dare” query, then read the result.3 a1 a2 ... an, which means you have obtained the answer. Output, in order, the IDs of Percy’s favorite, second favorite, ..., up to the -th favorite.
Input Format
(See the Description section.)
Output Format
(See the Description section.)
5
3
5
1 1 2 3
2 1 5
3 5 2 4 3 1
Hint
The above input and output are only to demonstrate the interactive format, and may not be logically consistent.
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Note that invalid output may cause mysterious issues such as WA / RE / TLE / MLE.
Translated by ChatGPT 5