{"trustable":false,"sections":[{"title":"Description","value":{"format":"MD","content":"给定一个长度为 $n$ 的序列 $a_1,a_2,\\dots,a_n$。\n\n$m$ 次操作:\n\n- `Q x y` , 查询区间 [x,y]中的最大值\n\n- `U x y` , 将 $a_x$ 更新为 $max(a_x,y)$"}},{"title":"Input","value":{"format":"MD","content":"第一行,有两个正整数 $n$ 和 $m$($1 \\leq n \\le 2\\times 10^5, 1 \\leq m\u003c5000$, 分别表示序列长度和操作次数。\n\n第二行包含 $n$ 个整数 $a_1,a_2,\\dots,a_n$。\n\n接下来有 $m$ 行。每一行有一个字符 $c$(只取 `Q` 或 `U`),和两个正整数 $x$,$y$。\n当 $c$ 为 `Q` 的时候,表示这是一条询问操作。\n当 $c$ 为 `U` 的时候,表示这是一条更新操作。\n操作如题面所示。\n\n保证在`int`范围内。"}},{"title":"Output","value":{"format":"MD","content":"对于每一次询问操作,输出答案。\n"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 6\n1 2 3 4 5\nQ 1 5\nU 3 6\nQ 3 4\nQ 4 5\nU 2 9\nQ 1 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n6\n5\n9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}