Why O(n) solution gives me TLE?

Правка en2, от Loser_, 2020-05-06 08:39:23

In this problem , I take the input and I store every value in ith index to a map.If my map[i] has a value than I push both map[i] and i to a vector pair. Here in worst case the code may run in 2*n times which is so to say O(n)times.But how I am getting here TLE with O(n) times? My submission is here.

Теги c++, #std::map, pair

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Loser_ 2020-05-06 08:39:23 4 Tiny change: 'o a vector<pair>>. Here in ' -> 'o a vector pair. Here in '
en1 Английский Loser_ 2020-05-06 08:37:42 441 Initial revision (published)