I think I've probed that for each N in the given range, there's a power of 2 satisfied all the conditions. But for some larger N, I don't have a effective algorithm to solve it on time!
So, will anybody give me some tips of the correct algorithm?
Hello everyone!
I made a pascal program and try to pass 474, but failed all the time. And I found nearly no pascal programmers passed that. And some used C or C++ said they cannot pass with pascal! Why? Who can tell me? Thanks?
I was very surprised when I got WA of this prolbem. My program used log, so I can pass the largest data, but I don't know why I always got WA!
Please help!