Help in solving RTE

Revision en1, by FlyingElephant, 2023-08-01 21:09:17

I was solving this problem. But I keep getting RTE on test2 and I dont understand why.

My idea is selecting the smallest 2*n elements by putting them into a set. Then I use two pointers on the array sorted by coordinate component in order to get the system of nested segments. No wonder what goes wrong with that.

SUBMISSION

Tags runtime error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English FlyingElephant 2023-08-01 21:09:17 460 Initial revision (published)