ScoobyDoobyDo's blog

By ScoobyDoobyDo, history, 3 years ago, In English

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 - Случайная победа (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

UPD: Solution: It was improper sorting which caused the TLE not HashSet Related functionality.

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it