kofhearts's blog

By kofhearts, history, 9 years ago, In English

I am confused by a case for the following problem

http://codeforces.net/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!

  • Vote: I like it
  • +7
  • Vote: I do not like it

»
9 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

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