{"raw_statement":[{"iden":"statement","content":"给出排列 $a_1,\\dots,a_n$，你需要维护序列 $b_1,\\dots,b_n$，初值为 $0$。\n\n共 $m$ 次操作：\n\n修改操作：给出 $l,r$，对每个 $(i,j)$ 满足 $l\\le i\\le j\\le r,\\;a_i\\le a_j$，将 $b_j$ 增加 $1$；\n\n查询操作：给出 $x$，查 $b_x$。"},{"iden":"input","content":"第一行两个整数 $n,m$；\n\n第二行 $n$ 个整数依次表示 $a_1,\\dots,a_n$；\n\n接下来 $m$ 行，每行 $1,l,r$ 或 $2,x$ 表示修改操作或查询操作。\n\n输入的所有数值为整数。"},{"iden":"output","content":"对每个查询操作，输出一行，包含一个整数，表示答案。"},{"iden":"note","content":"Idea：nzhtl1477，Solution：ccz181078，Code：ccz181078，Data：ccz181078\n\n对于 $100\\%$ 的数据，满足 \n\n$1\\le n,m\\le 2\\times 10^5$；\n\n$1\\le a_i\\le n$，$a_i$ 互不相同；\n\n$1\\le l\\le r\\le n$；\n\n$1\\le x\\le n$。"}],"translated_statement":null,"sample_group":[["8 10\n5 4 8 7 1 6 3 2\n1 2 5\n2 8\n1 2 8\n1 7 8\n2 4\n2 1\n2 6\n2 4\n1 8 8\n2 4\n","0\n4\n0\n3\n4\n4\n"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}