ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1013. K-based Numbers. Version 3

I'm puzzled
Posted by xwj1234 26 Oct 2008 13:22
How can some of the programs solve this problem within 0.001 s?
Re: I'm puzzled
Posted by nullman 18 Jan 2009 20:52
Simply because this problem has nothing to do with iterations but with permutation and combination. How many different representation for the sample are there [0, 1] over 10 positions it is 2^10 = 1024 but you cannot have "0" at 1st position so 2^10 - 2^9 = 512 and like so you continue to subtract the permutations where you would have two successive zeros and at the end you should get 90.