gokulraaj59's blog

By gokulraaj59, history, 2 years ago, In English

code here have made this code in python its giving TLE on Test-16 -> and have also tried with Fast_IO and PyPy too code

please need solutions in python only.

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

| Write comment?
»
2 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

I modified your code and it get accepted in python3 without using fastIO template also.
your code is full of operations that take O(n) like count , index and in operator.
so I replace them with bisect functions only to do this operations in O(logn).
so don't use this useless operations and use binary search.