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

Автор Makise_Kurisu, история, 6 лет назад, По-английски

Hi, I was trying to solve this problem from a coding test and came up with an O(n^4) solution which goes like first I will precompute the 2-D prefix sums of the entire grid and then for each cell naively Bruteforce for all possible solutions in n^2 operations, It would be great if you can share your insights/solutions for the problem. The contest is over 5 days back you can answer as late as you want until you are assured of this.

PROBLEM STATEMENT
  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Seems like it is supposed to be a brute force with 2d prefix sums.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why would not $$$O(n^4)$$$ pass?