Help Required: Why using Set.contains() in java giving TLE over n elements

Правка en2, от ScoobyDoobyDo, 2021-03-25 16:03:30

Hey Friends,

I had a fundamental query to ask which is somewhat related to the submission (I stated below), Does using set.contains() { mainly takes log(n) time } functionality take longer than 2 seconds to compute for the data as large as 2*10^5 (if we check for every input of the array that is) I am asking this because my submission to the problem 1490E - Accidental Victory (E. Accidental Victory), gave me TLE on the specified constrained. My submission -: 110974416 (look for solve() function part please)

or, Is there any other thing that I'm missing out here. Any Help regarding this will be appreciated. Thanks in advance

Теги #java, #set, #tle, probleme

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский ScoobyDoobyDo 2021-03-25 20:50:58 186
en2 Английский ScoobyDoobyDo 2021-03-25 16:03:30 19 Tiny change: '.\nThanks \nFellow java Coder' -> '.\nThanks in advance'
en1 Английский ScoobyDoobyDo 2021-03-25 15:51:52 728 Initial revision (published)