My python3 program’s result for this problem.

  • Identification of food (alice or bob) happens in linear time
  • compute log2 of required expression = x (let) .
  • if x>24 (224 > 107) then print “Infinity” else print 2x(python’s log function is very accurate.)

Please simply link to your submission, rather than taking a screenshot of it and telling us what your code does (although it’s great that you described the high-level logic of it :))

This fellow:

was seeing a similar pattern - AC on the second subtasks, but TLE on the (more constrained) first subtask. Maybe something to do with the number of testcases? Dunno :slight_smile:

Even I havent figured it out why (I faced the same problem)
So I just went with a bruteforce approach when l<=10 (Subtask 1)
It worked so I am not complaining :smile:!

Hey, Can you help me with this one
Getting wrong answer for some cases.

compute the recipe to whom it belongs in linear time.
calculate the numerator part of solution and denominator part of solution for the final ratio.
multiply result variable with numerator and divide by denominator to take care of overflow.

1 Like

oh i guess you were lucky for me found my bug. Thanks :):stuck_out_tongue:

1 Like

Glad to help XD