What data structure can be used to quickly perform such operations?

Правка en1, от Nextrix, 2022-05-16 16:19:06

Two sorted arrays A,B are given. You need to process requests of the following type:

1 l r — Delete the sub-section A[l,r], add it to the end of B, and then sort B.

2 l r — Delete the sub-section B[l,r], add it to the end of A, and then sort A.

It is necessary to output the resulting arrays A,B.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Nextrix 2022-05-16 16:19:06 376 Initial revision (published)