{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\u003cstrong\u003e背景\u003c/strong\u003e\u003cbr\u003e《To The Moon》是一款独立游戏,于2011年11月发布,是一款由RPG Maker驱动的角色扮演冒险游戏。\u003cbr\u003e《To The Moon》的故事背景基于一项技术,可以在一个垂死之人身上永久重构记忆。在这个问题中,我们将给你一个机会,来实现场景背后的逻辑。\u003cbr\u003e\u003cbr\u003e你被给定了N个整数A\u003csub\u003e[1]\u003c/sub\u003e, A\u003csub\u003e[2]\u003c/sub\u003e,..., A\u003csub\u003e[N]\u003c/sub\u003e。对这些整数,你需要实现以下操作:\u003cbr\u003e\u003cstrong\u003e1.\u003c/strong\u003e C l r d:为每个{l \u0026lt;\u003d i \u0026lt;\u003d r}中的A\u003csub\u003ei\u003c/sub\u003e添加一个常数d,并将时间戳增加1,这是唯一会导致时间戳增加的操作。\u003cbr\u003e\u003cstrong\u003e2.\u003c/strong\u003e Q l r:查询{l \u0026lt;\u003d i \u0026lt;\u003d r}中的当前和。\u003cbr\u003e\u003cstrong\u003e3.\u003c/strong\u003e H l r t:在时间t中查询{l \u0026lt;\u003d i \u0026lt;\u003d r}中的历史和。\u003cbr\u003e\u003cstrong\u003e4.\u003c/strong\u003e B t:返回到时间t。一旦你决定回到过去,你将无法再访问未来的版本。.. N, M ≤ 10\u003csup\u003e5\u003c/sup\u003e, |A\u003csub\u003e[i]\u003c/sub\u003e| ≤ 10\u003csup\u003e9\u003c/sup\u003e, 1 ≤ l ≤ r ≤ N, |d| ≤ 10\u003csup\u003e4\u003c/sup\u003e .. 系统从时间0开始,第一次修改发生在时间1,t ≥ 0,且不会将你引入未来状态。\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"n m\u003cbr\u003eA\u003csub\u003e1\u003c/sub\u003e A\u003csub\u003e2\u003c/sub\u003e ... A\u003csub\u003en\u003c/sub\u003e\u003cbr\u003e...(这里跟随着m个操作)"}},{"title":"输出","value":{"format":"HTML","content":"...(对于每个查询,简单地打印结果。)"}},{"title":"示例","value":{"format":"HTML","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\u003e10 5\r\n1 2 3 4 5 6 7 8 9 10\r\nQ 4 4\r\nQ 1 10\r\nQ 2 4\r\nC 3 6 3\r\nQ 2 4\r\n\r\n2 4\r\n0 0\r\nC 1 1 1\r\nC 2 2 -1\r\nQ 1 2\r\nH 1 2 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n55\r\n9\r\n15\r\n\r\n0\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}