StellarSpecter's blog

By StellarSpecter, history, 22 months ago, In English

Help me solve this problem please ->

**** **** There is an array of n elements, initially filled with zeros. You need to write a data structure that processes two types of queries: assign value v to all elements on the segment from l to r−1, find the sum on the segment from l to r−1.

Input

The first line contains two numbers n and m (1≤n, m≤100000), the size of the array and the number of operations. The following lines contain the description of the operations. The description of each operation is as follows: 1 l r v: assign value v to all elements on the segment from l to r−1 (0≤l<r≤n, 0≤v≤109). 2 l r: find the sum on the segment from l to r−1 (0≤l<r≤n).

Output

For each operation of the second type, print the corresponding value.

  • Vote: I like it
  • -35
  • Vote: I do not like it

| Write comment?
»
22 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

This title is ratism

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

So you can't click on this blog, right?