{"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\u003eAs another one of their crazy antics, the N (1 ≤ N ≤ 100,000) cows want Farmer John to race against the clock to answer some of their pressing questions.\u003c/p\u003e\r\n\r\n\u003cp\u003eThe cows are lined up in a row from 1 to N, and each one is holding a sign representing a number, A\u003csub\u003ei\u003c/sub\u003e (1 ≤ A\u003csub\u003ei\u003c/sub\u003e ≤ 1,000,000,000). The cows need FJ to perform Q (1 ≤ Q ≤ 50,000) operations, which can be either of the following:\u003c/p\u003e\r\n\r\n\u003cul\u003e\r\n\u003cli\u003eModify cow i\u0027s number to X (1 ≤ X ≤ 1,000,000,000). This will be represented in the input as a line containing the letter M followed by the space-separated numbers i and X.\u003c/li\u003e\r\n\r\n\u003cli\u003eCount how many cows in the range [P, Q] (1 ≤ P ≤ Q ≤ N) have A\u003csub\u003ei\u003c/sub\u003e ≤ X (0 ≤ X ≤ 1,000,000,000). This will be represented in the input as a line containing the letter C followed by the space-separated numbers P, Q, and X.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\r\n\u003cp\u003eOf course, FJ would like your help.\u003c/p\u003e\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eThe first line gives the integers N and Q, and the next N lines give the initial values of A\u003csub\u003ei\u003c/sub\u003e. Finally, the next Q lines each contain a query of the form \"M i X\" or \"C P Q X\".\u003c/p\u003e\r\n\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003ePrint the answer to each \u0027C\u0027 query, one per line.\u003c/p\u003e\r\n\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\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 6\r\n3\r\n4\r\n1\r\n7\r\nC 2 4 4\r\nM 4 1\r\nC 2 4 4\r\nC 1 4 5\r\nM 2 10\r\nC 1 3 9\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n3\r\n4\r\n2\r\n\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\u003eFJ has 4 cows, whose initial numbers are 3, 4, 1, and 7. The cows then give him 6 operations; the first asks him to count the how many of the last three cows have a number at most 4, the second asks him to change the fourth cow\u0027s number to 1, etc.\u003c/p\u003e\r\n\r\n\u003cb\u003eWarning: large input/output data.\u003c/b\u003e\n\u003c/div\u003e"}}]}