#P10831. [COTS 2023] 三角形 Trokuti
[COTS 2023] 三角形 Trokuti
Background
Translated from Izborne Pripreme 2023 (Croatian IOI/CEOI Team Selection) D1T3. .
Happy birthday to NaCly_Fish! (2024.7.28).
Problem Description
This is an interactive problem. The interactive library is non-adaptive.
There is a hidden simple undirected graph with exactly nodes. Your task is to reconstruct using the following type of query:
Query Given three pairwise distinct nodes , the judge returns the number of edges in the induced subgraph on these three nodes. Note that the answer can only be .
[Implementation Details]
Your program interacts with the judge through standard input and output.
-
: Make one query. The judge replies (read from standard input) with the number of edges in the induced subgraph on . Note that the answer can only be .
You must ensure , and are pairwise distinct. You may ask at most queries.
-
: Output your final answer. After outputting and a newline, output lines, each being a string of length .
The -th character in the -th line is if there is an edge between ; otherwise it is .
After each output, you must flush the buffer, e.g. cout.flush() in C++.
Input Format
See [Implementation Details].
Output Format
See [Implementation Details].
0
2
2
? 1 2 3
? 1 2 4
? 1 3 4
!
0001
0001
0001
1110
Hint
Scoring
Let be the maximum number of queries your program makes.
If , you get points.
Otherwise, your score is determined by the following table:
| Score | |
|---|---|
| $\displaystyle 10+10\cdot \frac{161\, 700-Q}{161\, 700-9\, 900}$ | |
| $\displaystyle 20+10\cdot \frac{9\, 900-Q}{9\,900-4\,500}$ | |
| $\displaystyle 30+70\cdot \frac{4\,950-Q}{4\,950-3\,400}$ | |
Translated by ChatGPT 5