Merged length commands
Разница между en1 и en2, 20 символ(ов) изменены
I recently came across a problem which reduced to the following:-<br>

Initially, we are provided a number line. Every second, we are being given one of the following two kind of commands
<br>
- add(L,R) : If we receive this command, we have to place a stick in the interval [L,R].
<br>
- remove(L,R) : We receive this command only if we received add(L,R) in an earlier time. Remove a stick [L,R] added earlier
<br><br>

After every second, we have to tell the total merged length. In a merged length, we count the overlap length of two or more sticks only once. For example if [1,5] and [4,7] sticks were placed, their mergal is [1,7] and mergal length 6. It would be great if someone can help me approach the problem.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский bitch_house 2020-07-21 00:31:10 20 Tiny change: 'val [L,R].\n- remove' -> 'val [L,R].<br>\n- remove'
en1 Английский bitch_house 2020-07-21 00:29:47 724 Initial revision (published)