today i was trying to solve problem 920F - SUM and REPLACE , but i failed because of tle
my code works as follow :
first , save locations for every index which have a value a[i] greater than 2 in a set
for every update , find the lower_bound for index l , and upper_bound for index r , and run a for between them , change every number with its number of divisors
for every ans , calculate it by fenwick tree
my code 82714261 failed on test 69 , you may would like to know that i tried with this problem by two data structers ( fenwick tree — sqrt decomposition ) , and both had a tle
can you help ?
thanks in advance