{"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\u003eEvery time someone is preparing to be interviewed, there is someone preparing the interview. While a good guy is preparing for the interview described in \u003ca title\u003d\"ILKQUERY\" href\u003d\"https://www.spoj.com/problems/ILKQUERY2/ILKQUERY/\"\u003e//www.spoj.com/problems/ILKQUERY/\u003c/a\u003e\u0026nbsp; your boss gives you the job of preparing the input/output for a new task.\u003cbr\u003e\u003cbr\u003eBut as always, your boss changes his mind so quickly... He will give you an array of integers, but sometime, he will say you that the element at index \u003cstrong\u003er \u003c/strong\u003eof the original array must toggle his state between active (1) and inactive (0).\u003cbr\u003eInitially all elements start as active elements. \u003cbr\u003eToggle the state of an element means to change it to active (1) if it was inactive, and change it to inactive (0) if it was active.\u003cbr\u003e\u003cbr\u003eMixed with the toggle operations, he also will give you several queries, represented with three integers, \u003cstrong\u003ei l k\u003c/strong\u003e meaning he wants to know how many active elements of value \u003cstrong\u003ek\u003c/strong\u003e exist between indexes\u003cstrong\u003e i\u003c/strong\u003e and \u003cstrong\u003el\u003c/strong\u003e (both inclusive)\u003c/p\u003e\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eInput consists of one test case.\u003c/p\u003e\r\n\u003cp\u003eThe first line contains two integers, \u003cstrong\u003eN\u003c/strong\u003e ( 1 ≤\u0026nbsp; N\u0026nbsp; ≤\u0026nbsp; 10\u003csup\u003e5\u003c/sup\u003e) and \u003cstrong\u003eQ\u003c/strong\u003e (1 ≤ Q\u0026nbsp; ≤ 10\u003csup\u003e5\u003c/sup\u003e).\u003c/p\u003e\r\n\u003cp\u003eThe next line contains \u003cstrong\u003eN\u003c/strong\u003e\u0026nbsp; integers \u003cstrong\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/strong\u003e ( -10\u003csup\u003e9\u003c/sup\u003e\u0026nbsp; ≤ a\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e).\u003c/p\u003e\r\n\u003cp\u003eThen \u003cstrong\u003eQ\u003c/strong\u003e lines follow. Each of them starts with an integer \u003cstrong\u003eq\u003c/strong\u003e which can be 0 or 1. If it\u0027s 0, then three integers \u003cstrong\u003ei l k\u003c/strong\u003e follow (0 ≤ i \u0026lt; N ; i ≤ l \u0026lt; N ; -10\u003csup\u003e9\u003c/sup\u003e ≤ k ≤ 10\u003csup\u003e9\u003c/sup\u003e). If it\u0027s 1, then an integer \u003cstrong\u003er\u003c/strong\u003e follows, meaning you have to toggle the state of the element at index \u003cstrong\u003er\u003c/strong\u003e. (0 ≤ r \u0026lt; N).\u003c/p\u003e\r\n\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each query starting with 0 (in the same order as the input) output a single line with the answer to that query. That is, output the amount of active elements of value \u003cstrong\u003ek\u003c/strong\u003e between the indexes \u003cstrong\u003ei\u003c/strong\u003e and \u003cstrong\u003el\u003c/strong\u003e (both inclusive).\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\u003e10 5\n2 2 3 2 1 5 4 2 6 3\n0 0 7 2\n1 3\n0 0 7 2\n1 6\n0 2 7 4\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n3\n0\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"}}]}