How to use bitmasking here, any hints
https://online.codingblocks.com/player/16783/content/5117?s=4016
How to use bitmasking here, any hints
https://online.codingblocks.com/player/16783/content/5117?s=4016
For not so easy Math,
Compute All prime numbers less than 20 and store it in array or vector.
Now
Hint-> Number of number upto n that are divisible by x are n/x.
Number of numbers upto n that are divisible by x and y are n/x+n/y-n/(xy)
Number of number upto n that are divisible by x and y and z are n/x+n/y+n/y-n/(xy)-n/(yz)-n/(xz)+n/(xyz)
So, use this approach to find number of numbers upto n which are divisble by prime numbers less than 20.
To find all subsets of prime numbers use bitmasking.
Hit like if u get it
Hi
Please check this link
Was not getting the intuition of creating subsets, thanks.
Understood it thanks