FIBEASY Sept Long2019

Please debug this solution : CodeChef: Practical coding for everyone
Getting WA for 80 point test case.

Make your own log base 2 function. It’ll pass

1 Like

Would this approach work in python without defining custom log2 ?

Nope ! many python users tried but it didn’t worked i guess. You need to design your own log2 function

1 Like

I see. Appreciate your help. Sad though.

1 Like

Use built-in bit_length function instead of log2 and bit shifting for calculating power of 2
Refer to this solution, CodeChef: Practical coding for everyone

1 Like

I just used log2(long double (n)) and it worked
https://www.codechef.com/viewsolution/26625972

1 Like