Why is this code not working for this question? Please tell me
http://codeforces.com/problemset/problem/467/B
Why is this code not working Why is this code not working for this question? Please tell me
hi @cbcao263 what error are you getting? Also have you tried taking XOR of the numbers and counting its set bits? As XOR will give 1 for differing bits.
Mam the error I am getting is runguard: warning: timelimit exceeded (wall time): aborting command
runguard: warning: command terminated with signal 15
In CB IDE
Also I have found something wrong
In Question it is written that binary representation differs at most by k bits.
So I should ad!=bd
But Previously I have did ad==bd.
Even then I am getting same error, Please explain
@cbcao263 in the CB IDE this error usually comes in the case of infinite loops or when you dont enter the input. You have entered the input so i checked for infinite loops and

in this while loop, you are not changing the value of a[i] or f, so the loop will run endlessly.
Sorry for that Mam.
Mam Even If I corrected the loop 
Like this One
I am getting wrong answer for Test Case 1 and correct for Test Case 2
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.