Help needed in finding python code bug

Revision en1, by harsh-apcr, 2024-03-18 20:09:51

Submission : https://mirror.codeforces.com/contest/1878/submission/252116337

I am new to python so I was practicing it on codeforces problems, the submission I referenced above is exceeding memory limits for very small values of $$$n$$$.

I think you don't need to really understand the problem statement, I suspect the problem is in implementation of segment tree. (as the solve() function really only has binary search which is implemented iteratively)

Any help will be appreciated

here is the code :

Spoiler

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English harsh-apcr 2024-03-18 20:09:51 1893 Initial revision (published)