#P10831. [COTS 2023] 三角形 Trokuti

    ID: 12286 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>2023交互题Special JudgeO2优化概率论随机化COCI(克罗地亚)

[COTS 2023] 三角形 Trokuti

Background

Translated from Izborne Pripreme 2023 (Croatian IOI/CEOI Team Selection) D1T3. 1s,0.5G\texttt{1s,0.5G}.

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 GG with exactly N=100N=100 nodes. Your task is to reconstruct GG using the following type of query:

Query Given three pairwise distinct nodes u,v,wu,v,w, the judge returns the number of edges in the induced subgraph on these three nodes. Note that the answer can only be 0,1,2,30,1,2,3.

[Implementation Details]

Your program interacts with the judge through standard input and output.

  • ? u v w\texttt{? u v w}: Make one query. The judge replies (read from standard input) with the number of edges in the induced subgraph on u,v,wu,v,w. Note that the answer can only be 0,1,2,30,1,2,3.

    You must ensure 1u,v,w1001\le u,v,w\le 100, and u,v,wu,v,w are pairwise distinct. You may ask at most 161700161\, 700 queries.

  • !\texttt{!}: Output your final answer. After outputting !\texttt{!} and a newline, output NN lines, each being a 01\texttt{01} string of length NN.

    The jj-th character in the ii-th line is 1\texttt{1} if there is an edge between (i,j)(i,j); otherwise it is 0\texttt{0}.

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 QQ be the maximum number of queries your program makes.

If Q>161700Q\gt 161\, 700, you get 00 points.

Otherwise, your score is determined by the following table:

QQ Score
9900Q1617009\, 900\le Q\le 161\, 700 $\displaystyle 10+10\cdot \frac{161\, 700-Q}{161\, 700-9\, 900}$
4950Q99004\, 950 \le Q\le 9\, 900 $\displaystyle 20+10\cdot \frac{9\, 900-Q}{9\,900-4\,500}$
3400Q49503\, 400\le Q\le 4\, 950 $\displaystyle 30+70\cdot \frac{4\,950-Q}{4\,950-3\,400}$
Q3400Q\le 3\, 400 100100

Translated by ChatGPT 5