Time Complexity Calculation

Правка en2, от I_lOVE_ROMAN, 2023-10-30 15:29:00

For this Problem

1829E - Озера

The solution is written in O(n*m)

But How it is possible if there is recursion calls inside the nested solution.

Solution in tutorial is:

https://codeforces.com/blog/entry/116108 (Problem E)

Please someone help me understand the time complexity?Shouldn't it be O(n*m*n*m).I know we are not checking same grid twice.

Please someone help me.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский I_lOVE_ROMAN 2023-10-30 15:29:00 2 Tiny change: 'oblem:1829A]\n\n\nThe' -> 'oblem:1829E]\n\n\nThe'
en1 Английский I_lOVE_ROMAN 2023-10-29 12:50:26 432 Initial revision (published)