13C Codeforces

Revision en1, by 00x3f00f3x, 2020-09-28 16:32:55

Hello everyone. Recently I've explored a better solution O(N*logN) instead of O(N^2) for 13C (Sequences) using Priority Queue: https://mirror.codeforces.com/contest/13/submission/94130902. But I can't understand why it is work. Can somebody explain the main idea of O(N*logN) solution for me? Thanks so much.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English 00x3f00f3x 2020-09-28 16:32:55 323 Initial revision (published)