Problem Link : 1995C - Squaring
I have tried to implement the float method from the editorial.
I am using base 2 for log here. In the first code, I am calculating the difference of b[i-1] and b[i], tmp is the number of times log(2)=1 has to be added into b[i]. If b[i-1]-b[i]>0, We are adding it's ceil value to the total operations ( ops ) and also to b[i] itself.
However this solution gives wrong answer on test-case 2, my guess is my outputs are bigger than answer expected.
Note: I have removed input templates from codes to make them short, rest is intact. You can also refer to the submission links.
Code with wrong answer
submission : 272991530
While this code works
submission : 272991530