{"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\u003e\r\nYou are given a \u003cstrong\u003e1-indexed\u003c/strong\u003e array \u003cstrong\u003eX\u003c/strong\u003e, consisting of\u003cstrong\u003e N\u003c/strong\u003e integers, and a set of \u003cstrong\u003eQ\u003c/strong\u003e queries. There are two kinds of queries:\u003c/p\u003e\r\n\r\n\u003col\u003e\r\n \u003cli\u003e\u003cstrong\u003e0 a b c\u003c/strong\u003e\u003cbr\u003e Here you are required to return the number of elements with indices in \u003cstrong\u003e[a,b]\u003c/strong\u003e\u003cbr\u003e greater than or equal to \u003cstrong\u003ec\u003c/strong\u003e\u003c/li\u003e\r\n \u003cli\u003e\u003cstrong\u003e1 a b\u003c/strong\u003e\u003cbr\u003e Here you are required to change the \u003cstrong\u003ea\u003csup\u003eth\u003c/sup\u003e\u003c/strong\u003e element of array to \u003cstrong\u003eb\u003c/strong\u003e. \u003c/li\u003e\r\n\u003c/ol\u003e\r\n\r\n\u003ch3\u003eInput Format:\u003c/h3\u003e\r\n\u003cp\u003eFirst line contains \u003cstrong\u003eN\u003c/strong\u003e, the number of elements in the array \u003cstrong\u003eX\u003c/strong\u003e. The next line contains \u003cstrong\u003eN\u003c/strong\u003e space separated integers representing the elements of \u003cstrong\u003eX\u003c/strong\u003e. The third line of input contains a single integer, \u003cstrong\u003eQ\u003c/strong\u003e, the number of queries. The next \u003cstrong\u003eQ\u003c/strong\u003e lines of input each contain queries of two kinds as described above. \u003c/p\u003e\r\n\r\n\u003ch3\u003eOutput Format:\u003c/h3\u003e\r\n\u003cp\u003e\u003cstrong\u003eQ \u003c/strong\u003elines with the ith line contains the answer for the \u003cstrong\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/strong\u003e query \u003c/p\u003e\r\n\r\n\u003ch3\u003eConstraints:\u003c/h3\u003e\r\n\u003cp\u003e1 ≤ N ≤ 5*10^5\u003cbr\u003e 1 ≤ Q ≤ 10^5\u003cbr\u003e 1 ≤ X[i] ≤ 10^9\u003cbr\u003e 1 ≤ a ≤ b ≤ N for query type 0\u003cbr\u003e 1 ≤ a ≤ 10^5, 1 \u0026lt; b ≤ 10^9 for query type 1\u003cbr\u003e 1 ≤ c ≤ 10^9\u003cbr\u003e\u003c/p\u003e\r\n\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\u003e5\r\n1 2 3 4 5\r\n3\r\n0 1 5 10\r\n1 2 20\r\n0 1 3 10\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\r\n\u003cp\u003e\u003cstrong\u003eProblem Setter: Pulkit Goel and Vidit Gupta\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e"}}]}