Can somebody describe their solution to http://codeforces.com/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.

# | User | Rating |
---|---|---|

1 | tourist | 3556 |

2 | wxhtxdy | 3520 |

3 | Benq | 3368 |

4 | Radewoosh | 3359 |

5 | ecnerwala | 3287 |

6 | mnbvmar | 3280 |

7 | LHiC | 3276 |

8 | sunset | 3264 |

9 | maroonrk | 3183 |

10 | Um_nik | 3153 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 189 |

2 | Radewoosh | 177 |

3 | tourist | 173 |

4 | antontrygubO_o | 172 |

5 | Vovuh | 168 |

6 | PikMike | 166 |

7 | majk | 159 |

8 | rng_58 | 157 |

9 | Um_nik | 154 |

9 | farmersrice | 154 |

Can somebody describe their solution to http://codeforces.com/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.

↑

↓

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/16/2019 09:33:36 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

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" (unlessp! = 2 we can't receive "=") we got a prefix of binary representation off(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.^_^