Need help on 438D — The Child and Sequence

Правка en1, от xuanquang1999, 2015-08-05 12:03:27

I'm trying to solve Div1D on Codeforces Round 250 — The Child and Sequence. My idea is the same with the editorial: Build the maximum and sum segment tree, and for queries of type 2, I keep finding the largest number in the segment, mod it by x until there's no number in the segment larger or equal x. (All is done by segment tree). However, I got TLE on test 4.

My submission: 12348730

I can't find anything wrong with my solution, so that's why I need help on this. Can anyone help me with this? Thanks in advanced.

Теги help me

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский xuanquang1999 2015-08-05 12:03:27 633 Initial revision (published)