#1341
Unrated
Interactive Sort
인터랙티브채점 준비중
시간 제한
10s
메모리 제한
512MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Ivan wants to play a game with you. He took all integers from 11 to nn inclusive, shuffled them and then put all even numbers into array ee and all odd numbers into array oo.

Your task is to find arrays ee and oo.

You can ask Ivan questions of certain kind. Each question consists of two integers ii and jj. For each question Ivan says whether e[i]<o[j]e[i] < o[j] or not.

You can ask at most 300000300\, 000 questions.

입력

출력

상호작용

First, the testing system writes the integer nn (1n100001 \le n \le 10\,000) — the number of integers Ivan used.

Your solution shall print requests of two types:

  • "? ii jj". 1in2,1jn21 \le i \le \lfloor \frac{n}{2} \rfloor, 1 \le j \le \lceil \frac{n}{2} \rceil. The testing system responds with the symbol "<" if e[i]<o[j]e[i] < o[j] or with the symbol ">" otherwise.
  • "! e1 e2 ... en2 o1 o2 ... on2e_1~e_2~...~e_{\lfloor \frac{n}{2} \rfloor}~o_1~o_2~...~o_{\lceil \frac{n}{2} \rceil}" tells the values of ee and oo that your program has determined.

Don't forget to flush the output after each request!

Your solution must issue exactly one request of the second type, which must be the last request, and the solution must terminate gracefully after issuing it.

Your solution is allowed to issue at most 300000300\,000 requests of the first type.

For each test case the number nn is fixed and the numbers are shuffled using Java built-in shuffle function with fixed seed.

예제 입력 1

5
>
>
<
>
<
<

예제 출력 1

? 1 1
? 1 2
? 1 3
? 2 1
? 2 2
? 2 3
! 4 2 1 3 5
코드 제출

이 문제는 현재 제출할 수 없습니다.

이 현상이 잘못되었다고 생각될 경우 관리자한테 문의주세요.

내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.