data structure problem

Revision en3, by arbcrt040, 2015-08-05 18:25:15

Greetings.

I was trying to solve one problem, but couldn't. It's like the RMQ problem but with add at position operation.

There are 2 operations:

ADD i X ---- ads X after ith element.
QUERY l r ---- RMQ of [l; r].

Can someone help me, please? Thanks in advance.

(Sorry bad English)

EDIT: Thanks everybody for help! Got accepted :)

Tags data structures, advanced data structure, segment tree, rmq

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English arbcrt040 2015-08-05 18:25:15 56 Tiny change: 'd English)' -> 'd English)\n\n**EDIT:** Thanks everybody for help! Got accepted :)'
en2 English arbcrt040 2015-08-05 15:00:24 10
en1 English arbcrt040 2015-08-05 14:59:36 327 Initial revision (published)