f2lk6wf90d's blog

By f2lk6wf90d, history, 4 years ago, In English

Hello everyone, I thought of this problem after reading 875D - High Cry and I can't figure out a solution.
Let's call an integer y a subset of an integer x, if x | y == x.

You have to answer q queries of two types:

  • 1 x Add the integer x to the set S. (initially, the set S is empty)
  • 2 x Of all the integers currently in S, how many is x a subset of?

1 ≤ x ≤ 109, 1 ≤ q ≤ 105.

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