Count numbers of 1 multiple of 3 till N

Правка en1, от prathams, 2015-07-18 22:28:59

How to count numbers whose binary representation has number of 1's multiple of 3 for all numbers between 1 to N.

For ex — N = 19 then ans = 5 Since, 7, 11, 13, 14, 19 have number of 1's multiple of 3.

Constraint : n < 1016

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский prathams 2015-07-18 22:28:59 283 Initial revision (published)