Strict Evaluation

View as PDF

Submit solution

Points: 17
Time limit: 1.0s
Memory limit: 256M

Problem type

You have an array of N (1 \le N \le 100\,000) elements, indexed from 1 to N. There are Q (1 \le Q \le 100\,000) operations you need to perform on it.

Each operation is one of the following:

  • 1 l r v Increment each value in the range [l,r] by v.
  • 2 l r v Make each value in the range [l,r] equal to v (i.e. for each element a_i, such that l \leq i \leq r, set a_i:=v).
  • 3 l r Output the minimum value in the range [l,r].

In operations 1 and 2, v is guaranteed to be an integer in the range [1,100\,000]. Every value in the starting array is also guaranteed to be in this range.

Input Specifications

The first line has N and Q.

The second line has N integers, the original array.

The next Q lines each contain an operation in the format described above.

Output Specification

For each operation of type 3, output the answer on its own line.

Sample Input

5 3
1 2 3 4 5
3 2 4
2 2 4 10
3 2 5

Sample Output

2
5

Comments


  • -7
    magicalsoup  commented on Jan. 4, 2020, 11:21 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 4
    4fecta  commented on Jan. 3, 2020, 10:57 p.m.

    Can this be called Segment Tree Test 2?


    • 0
      richardzhang  commented on Jan. 9, 2020, 1:16 a.m.

      I pretty much created it with the intent of just that, because I couldn't find a template problem that had both range increment and range assignment together to test things on lolol.