Блог пользователя MarioYC

Автор MarioYC, 13 лет назад, По-английски

Got AC, silly mistake =(

My approach works as follows:


  • For every operation, get all the sub-rectangles affected and save all these operations (function add)
  • Since M < 50, use grid compression
  • Count the number of 0's that there were initially in a sub-rectangle (function count), if the state of the bulbs changed add the number of 0's else add the number of 1's.
Code: http://pastie.org/2125732
  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится