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 1057. Amount of Degrees

WOW! How did all of you solve this problem so that it doesn't go out of the time limit?
Posted by Algorist 7 Oct 2001 02:01
Re: WOW! How did all of you solve this problem so that it doesn't go out of the time limit?
Posted by Lalescu Liviu 7 Oct 2001 13:24
I have a nice solution. I guess I am not allowed to put it
here (if I am, tell me please). If you want it, e-mail me
at LalescuLiviu@xnet.ro
Re: WOW! How did all of you solve this problem so that it doesn't go out of the time limit?
Posted by Marat Bakirov 8 Oct 2001 19:39
Well, you can post your solution, I won't delete your
message, But I will be angry about it :)

I think you'd better share your ideas, and not sources.
Re: WOW! How did all of you solve this problem so that it doesn't go out of the time limit?
Posted by carol_m1 22 Jun 2003 14:12
> I have a nice solution. I guess I am not allowed to put it
> here (if I am, tell me please). If you want it, e-mail me
> at LalescuLiviu@xnet.ro
please show your idea
Re: WOW! How did all of you solve this problem so that it doesn't go out of the time limit?
Posted by erik 6 Aug 2003 18:26
I have a function gen(n) which generates the n:th integer, which
written in base b has exactly k ones and the rest zeros.

Then, using that function, I do a binary search to find the least a
such that gen(a)>=x and the least b such that gen(b)>=y+1.

The answer is then b-a.