|
0
if(x>no||no_of_ops>x){ ans=no }else ans = yes this is because we can divide each element in sum by two, increasing cnt of elements by one // it is only not possible when x>no |
|
0
no-=2^((int)Math.floor(Math.log(no)/Math.log(2))) // log(no)/log(2) has same effect as taking log base 2 ++no_of_op |
|
0
dude just do greedy int no = inp(1) int x = inp(1) int n_of_ops=0; while(no>0){ |
|
0
Reach pupil before new year and solve 300 problems |