1327B I can't understand about the time complexity

Revision en1, by jhpark_inha, 2020-03-27 19:10:15

According to the 1327B's solution, O(n+m) is taken.

But i don't think that. In this situation,

N = 100'000 1st princess can marry 1 2 3 4 ... 100'000 2nd princess can marry 1 2 3 4 .., 100'000 . . . 100'000th princess can marry 1 2 3 4 .. 100'000

Total time complexity will be O(N^2), if i understood that solution correct.

Can you help me?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English jhpark_inha 2020-03-27 19:10:15 408 Initial revision (published)