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