{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"Cho dãy $A$ gồm $n$ số nguyên. Bạn cần thực hiện $m$ thao tác:\n- $0 \\ x \\ y$ - gán $a_x\u003dy$;\n- $1\\ l\\ r$ - In ra $\\max(a_i+a_{i+1}+\\cdots+a_j) (\\forall i,j; l \\le i \\le j \\le r)$"}},{"title":"Input","value":{"format":"MD","content":"- Dòng 1: ghi số nguyên $n (1 \\le n \\le 50000)$;\n- Dòng 2: ghi $n$ số nguyên $a_1,a_2,\\cdots,a_n ( |a_i| \\le 10000;\\forall i\u003d1 \\to n)$;\n- Dòng 3: ghi số nguyên $m (1 \\le m \\le 50000)$;\n- Tiếp theo là $m$ dòng, mỗi dòng mô tả một truy vấn theo mô tả của đề bài."}},{"title":"Output","value":{"format":"MD","content":"- Với mỗi truy vấn dạng $1\\ l\\ r$ , hãy ghi ra kết quả tìm được trên một dòng."}},{"title":"Sample input","value":{"format":"MD","content":"3\n1 2 3\n3\n1 1 3\n0 3 -3\n1 2 3"}},{"title":"Sample output","value":{"format":"MD","content":"6\n2"}},{"title":"Explanation","value":{"format":"MD","content":"- Dãy ban đầu là $(1,2,3)$;\n - Truy vấn 1 in ra $1+2+3\u003d6$;\n - Truy vấn 2, dãy trở thành $(1,2,-3)$;\n - Truy vấn 3 chọn $i\u003d2,j\u003d2$ tổng là $2$."}}]}