How to get the Problem E. Lucky Array accepted using Python?

Revision en1, by N0V1CE, 2023-01-10 06:46:12

Hello Everyone,

I am trying to solve the problem E from Codeforces Beta Round #91 (Div 1. only). I am facing issues in getting it accepted. It is giving me TLE on test case 62. I am not sure why is this happening, can anyone please help me resolve the same.

I think it might be because of the func I have used in lazy segment tree class. If anyone has any suggestion or update feel free to write it down in the comments.

Here is my submission and this is the lazy segment tree.

Tags lazy propagation, segment tree, problem solving, time limit exceeded

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English N0V1CE 2023-01-10 06:46:12 761 Initial revision (published)