Блог пользователя kofhearts

Автор kofhearts, история, 8 лет назад, По-английски

I am confused by a case for the following problem

http://codeforces.com/contest/108/problem/B

the answer to the following test case is YES

7 1 2 3 4 8 16 32

I thought it was NO since the value that can fit in 16 bits, the square of that value will fit in 32 bits so therefore Tuftuf will not stop using Gava.

Thanks for the help!

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится +4 Проголосовать: не нравится

We can choose 3 and 4. Maximum x will be 23 - 1 = 7(1112), but 72  =  49(1100012) does not fit in 4 bits.