Can somebody describe their solution to http://codeforces.me/gym/100519/problem/I ? Somehow I can't shake the feeling that it's enough to always multiply with 2, but I cannot substantiate my intuition to turn this into an algorithm.
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 154 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 146 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 135 |
| 9 | maroonrk | 133 |
| 10 | cry | 130 |
Can somebody describe their solution to http://codeforces.me/gym/100519/problem/I ? Somehow I can't shake the feeling that it's enough to always multiply with 2, but I cannot substantiate my intuition to turn this into an algorithm.
| Название |
|---|



spoiler
The first one is more along the lines of what I was thinking :) The second idea is magical.
It became one of my favourite problems few days ago :)! Indeed, we will use just multiplying by 2. Consider fraction
. If we have a fraction f, we multiply it by 2 and then receive information ">" we know that
and if we receive "<", we know that
. Inductively if we receive informations "<<>><><" and we change each "<" to "1" and ">" to "0" (unless p! = 2 we can't receive "=") we got a prefix of binary representation of f (following "0."), so "<<>><><" changes to "0011010" and we know that
. Using 40 questions we can get approximation of
with error at most 2 - 40, but if
and
are potential starting fractions we know that
, so this precision is sufficient to uniquely determine starting fraction :)!
Oh wow, that's a really nice solution! Thanks for sharing.
Amazing!
Oh my god
A wise man.^_^