logo AlgoBeat OnlineJudge
登录 注册

#209289. [EC Final 2022] Inversion

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

There is a hidden permutation of . You want to find it by asking the parity of the number of inversions of .

You can query in the format , and the interactor will respond you . is when and when .

输入格式

Firstly, you should read the integer ().

After that, you can make no more than queries. To make a query, output ``'' () on a separate line, then you should read the response from standard input.

To give your answer, print ``'' on a separate line. The output of the answer is \textbf{not} counted towards the limit of queries.

After that, your program should terminate.

After printing a query, do not forget to output end of line and flush the output. To do this, use or in C++, in Java, in Pascal, or in Python.

It is guaranteed that the permutation is fixed in advance.

样例

样例输入 1

3

0

0

1

样例输出 1


? 1 2

? 1 3

? 2 3

! 2 3 1