{"trustable":true,"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":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eYou are given sequence A[0], A[1]...A[N - 1]. (0 \u0026lt;\u003d A[i] \u0026lt; 2^32)\u003c/p\u003e\r\n\u003cp\u003eYou are to perform Q operations:\u003c/p\u003e\r\n\u003col\u003e\r\n\u003cli\u003e\u003cstrong\u003eI pos val\u003c/strong\u003e, insert number \u003cstrong\u003eval \u003c/strong\u003ein sequence before element with index \u003cstrong\u003epos\u003c/strong\u003e. (0 \u0026lt;\u003d val \u0026lt; 2^32, if \u003cstrong\u003epos\u003c/strong\u003e\u0026nbsp;\u003d \u003cstrong\u003ecurrent_length\u003c/strong\u003e\u0026nbsp;then you should add number to the end of the sequence)\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003eD pos\u003c/strong\u003e, delete element with index \u003cstrong\u003epos \u003c/strong\u003efrom sequence.\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003eR pos val\u003c/strong\u003e, replace element with idex \u003cstrong\u003epos \u003c/strong\u003eby \u003cstrong\u003eval\u003c/strong\u003e. (0 \u0026lt;\u003d val \u0026lt; 2^32)\u003c/li\u003e\r\n\u003cli\u003e\u003cstrong\u003eQ l r k\u003c/strong\u003e, answer Σ\u0026nbsp;A[i] * (i - l + 1)^k modulo 2^32, for l \u0026lt;\u003d i \u0026lt;\u003d r. (0 \u0026lt;\u003d k \u0026lt;\u003d 10)\u003c/li\u003e\r\n\u003c/ol\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eThe first line of the input contains an integer N (1 \u0026lt;\u003d N \u0026lt;\u003d 100000).\u003c/p\u003e\r\n\u003cp\u003eThe following line contains N integers, representing the starting sequence A[0]...A[N-1].\u003c/p\u003e\r\n\u003cp\u003eThe third line contains an integer Q (0 \u0026lt;\u003d Q \u0026lt;\u003d 100000).\u003c/p\u003e\r\n\u003cp\u003eNext Q lines contains the queries in given format.\u003c/p\u003e\r\n\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each\u0026nbsp;\"\u003cstrong\u003eQ\u003c/strong\u003e\"\u0026nbsp;operation, print an integer (one per line) as described above.\u003c/p\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e4\r\n1 2 3 5\r\n7\r\nQ 0 2 0\r\nI 3 4\r\nQ 2 4 1\r\nD 0\r\nQ 0 3 1\r\nR 1 2\r\nQ 0 1 0\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n26\r\n40\r\n4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/div\u003e"}}]}