|  | 
|  | 
| вернуться в форум | WOW! How did all of you solve this problem so that it doesn't go out of the time limit?Re: WOW! How did all of you solve this problem so that it doesn't go out of the time limit? I have a nice solution. I guess I am not allowed to put ithere (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? Well, you can post your solution, I won't delete yourmessage, 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? > 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? Послано erik  6 авг 2003 18:26I have a function gen(n) which generates the n:th integer, whichwritten 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.
 | 
 | 
|