Editorial for MEC '16 P1 - Bat-Doctor


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

This problem is just simple math. Store all the points where there is an X from left to right, then find the atan of the slope between two consecutive points and add 90 degrees to it for the final answer.

Time Complexity: \mathcal{O}(RC) where R is the rows and C is the columns.


Comments


  • 0
    sre0x2a  commented on May 9, 2026, 10:10 a.m.

    Considering a 26% submission rate, I think it is probably a little more than just apply atan of the slope and add 90 lol