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

18484번 - Eight Sins 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB263463719.681%

문제

Does every interactive problem have to be binary search?

Somebody has secretly set $n$ integers $a_1, a_2, \ldots, a_n$ such that 1ドル \le a_1 < a_2 < \ldots < a_n \le k$. You have to guess these integers one by one interacting with the testing system.

Initially $i = 1$. To make a guess, you may send an integer $x$ such that 1ドル \le x \le k$. The system will reply with a string containing a single character:

  • ">" if $a_i > x$;
  • "<" if $a_i < x$;
  • "=" if $a_i = x$.

In case $a_i = x,ドル the value of $i$ is increased by 1. You win after you guess all $n$ integers correctly, that is, when $i$ reaches $n + 1$.

Note that the values of $a_1, a_2, \ldots, a_n$ are not chosen in advance by the interactor, but all replies to your queries will be consistent with some valid set of $a_1, a_2, \ldots, a_n$ at any time.

입력

출력

제한

프로토콜

First, the testing system writes a single line containing two integers $n$ and $k$ (1ドル \le n \le 100$; $n \le k \le 10^9$), denoting the number of integers to guess and their maximum allowed value.

Your solution shall print requests. Each request consists of a single integer $x$ on a single line. The testing system responds with a single line containing a single character ">", "<", or "=" as described in the problem statement.

Do not forget to flush the output after each request!

Your solution must terminate gracefully after receiving "=" from the testing system exactly $n$ times.

Your solution is allowed to issue at most 2600 requests.

예제 입력 1

3 6
<
<
=
>
=
=

예제 출력 1

6
3
1
3
4
5

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 5: Gennady Korotkevich Contest 4 H번

Contest > Open Cup > 2018/2019 Season > Stage 11: Grand Prix of Gomel H번

채점 및 기타 정보

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

출처

대학교 대회

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

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