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.

Before contest

CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!)

4 days

Register now »

CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!)

4 days

Register now »

*has extra registration

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

1 | tourist | 3690 |

2 | jiangly | 3647 |

3 | Benq | 3581 |

4 | orzdevinwang | 3570 |

5 | Geothermal | 3569 |

5 | cnnfls_csy | 3569 |

7 | Radewoosh | 3509 |

8 | ecnerwala | 3486 |

9 | jqdai0815 | 3474 |

10 | gyh20 | 3447 |

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

1 | maomao90 | 173 |

2 | awoo | 164 |

3 | adamant | 163 |

4 | TheScrasse | 160 |

5 | nor | 157 |

6 | maroonrk | 156 |

7 | -is-this-fft- | 152 |

8 | Petr | 146 |

8 | orz | 146 |

10 | pajenegod | 145 |

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-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/21/2024 07:01:27 (i2).

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.^_^