| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 512 MB | 263 | 46 | 37 | 19.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.
3 6 < < = > = =
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번