Logo
(追記) (追記ここまで)

31327번 - Small Numbers Search 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB65583.333%

문제

This is an interactive problem.

Jury has a permutation of numbers from 1ドル$ to $n$. Your task is find positions where numbers from 1ドル$ to $k$ are placed. To do this, you can use jury's program which can compare numbers in any two positions in the permutation.

입력

The first line of input contains two integers $n$ and $k$: the order of permutation and the number of positions to find. In all tests except the example, $n = 10,000円$ and $k \le 10$.

Then follow the answers for your requests, one per line. If the first of the two numbers to compare is less than the second one, the line will contain a single character "<", otherwise, it will contain a single character ">".

출력

If you want to compare numbers on positions $i$ and $j,ドル you must print one line "? $i$ $j$". Here, $i$ and $j$ must be different integers between 1ドル$ and $n$. You can request a comparison at most 10ドル,700円$ times.

If you found all positions for all numbers from 1ドル$ to $k,ドル print "! $pos_1$ $pos_2$ $\dots$ $pos_k$", and then terminate your program.

To prevent output buffering, after printing each line, consider issuing the command which flushes the buffer. For example, this command may be fflush(stdout) in C or C++, System.out.flush() in Java, flush(output) in Pascal or sys.stdout.flush() in Python.

Also, don't forget to put a newline at the end of every line of your output.

제한

예제 입력 1

3 3
(waiting for output)
<
(waiting for output)
>
(waiting for output)
<

예제 출력 1

(reading input)
? 1 2
(reading input)
? 3 1
(reading input)
? 2 3
(reading input)
! 1 2 3
(terminating)

힌트

In the example, the jury's permutation is 1 2 3.

출처

Contest > Open Cup > 2014/2015 Season > Stage 5: Grand Prix of Peterhof C번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /