Giá trị lớn nhất ver2

View as PDF

Submit solution


Points: 0.10 (partial)
Time limit: 0.5s
Memory limit: 512M
Input: stdin
Output: stdout

Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Cho một dãy gồm ~n~ phần tử có giá trị ban đầu bằng ~0~.

Cho ~m~ truy vấn có dạng:

  • ~0~ ~x~ ~y~ ~k~: tăng mỗi phần tử từ vị trí ~x~ đến vị trí ~y~ lên ~k~ đơn vị.
  • ~1~ ~x~ ~y~: cho biết giá trị lớn nhất của các phần tử có vị trí nằm trong đoạn [~x~, ~y~]

Input

  • ~n~: số phần tử của dãy ~(n \leq 50000)~.

  • ~m~: số lượng biến đổi và câu hỏi ~(m \le 10^5)~.

    • biến đổi có dạng: ~0~ ~x~ ~y~ ~k~ ~(1 \le k \le 10000)~
    • câu hỏi có dạng: ~1~ ~x~ ~y~

Output

Ghi ra trả lời cho lần lượt từng câu hỏi.

Sample Input

6 3
0 1 3 3
0 4 6 4
1 1 6

Sample Output

4

Comments

Please read the guidelines before commenting.



  • 2
    Anhngutoan  commented on Feb. 4, 2025, 1:07 a.m. edited

    bruh


  • -5
    huy_lovely  commented on July 25, 2024, 4:29 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -22
    AnonymousExe  commented on July 6, 2024, 2:00 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -52
    PPAP_1264589  commented on July 31, 2021, 1:43 p.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -31
      nictysine1  commented on April 8, 2022, 12:47 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • 12
    leduykhongngu  commented on May 22, 2021, 8:39 a.m.

    Time limit bài này đã được giảm xuống 0.5s nhé :3