TLE when using set

Правка en1, от ravi_sumit33, 2019-12-01 20:26:44

Hello Codeforces!

I was solving this problem and came up with an approach using set. I made submission but got TLE. If I am correct, time complexity of this submission is nlogn as total number of insert/erase operations in set is O(n) and logn for each upper_bound.

I know this approach is not the best one but considering constraints given in the problem, this should get an AC.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ravi_sumit33 2019-12-01 20:26:44 515 Initial revision (published)