Why O(nlogn) isn't working for n=200000

Revision en2, by Quirkless, 2021-09-29 00:42:12

Hello everyone, I need help please. For given problem: https://codeforces.com/problemset/problem/1574/C my submission: https://codeforces.com/contest/1574/submission/130212274 My code is giving right answer but on test case 6, it is showing TLE, which it shouldn't as I just used around 2nlogn+5n operations, which I think shouldn't cause problem. Also, I doubt that whether TLE is because of sorting of vector , or maybe sorting of vector<pair<long long,int>>, I don't know , please tell me something.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Quirkless 2021-09-29 00:42:12 1 Tiny change: ' of vector<long long' -> ' of vector <long long'
en1 English Quirkless 2021-09-29 00:41:00 556 Initial revision (published)