시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 34 | 10 | 9 | 69.231% |
This is an interactive problem.
A game with permutations has the following rules. The judge program first generates some permutation $p$ of length $N$ and tells you $N$. This permutation is never changed throughout the game.
Your task is to guess the permutation. For that purpose, you may use permutations of length $N$ as queries. Let's see how the jury program answers them.
Note that you can ask no more than 240 queries before you tell the answer.
First your program reads a single integer $N$ ($1 \le N \le 400$) --- the length of the permutation you need to guess.
After that you can make queries. Each query consists of $n+1$ space-separated tokens. The first token is '?
', then the permutation you are using in the query follows. Don't forget to terminate the line by the end-of-line character and to flush the output after sending the query. Then you read the jury program's answer --- a sorted array of $n$ integers.
When you are ready to guess the permutation, print $n+1$ space-separated tokens: the first token is '!
' and then the permutation you guess follows.
5 0 0 1 3 4 0 0 2 2 4 0 2 2 2 2 0 0 0 0 0
? 2 3 1 4 5 ? 1 2 3 4 5 ? 5 4 3 2 1 ? 5 2 1 4 3 ! 5 2 1 4 3