How can I improve CF364 Div2B

Правка en1, от reclusion, 2016-07-23 22:20:10

Here's my code : http://pastebin.com/WPfr9ZX4

Initially all columns and rows have N items each. After item is placed on the grid I subtract 1 from all the columns and rows and update the result accordingly. On test 7 I get TLE. How can I make this faster?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский reclusion 2016-07-23 22:21:55 78
en1 Английский reclusion 2016-07-23 22:20:10 288 Initial revision (published)