{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e小 $\\mathcal{L}$ 给出一个长度为 $n$ 的序列 $a$,序列中的每一个元素都在 $[0,m)$ 范围内,现在对于每一个 $i\\in[p,q]$ 求出有多少个区间 $[l,r]$ 中元素构成的集合的 $\\operatorname{MEX}$ 为 $i$。(一个集合的 $\\operatorname{MEX}$ 为这个集合中第一个没有出现的自然数,如 $\\operatorname{MEX}\\{0,1,2\\}\u003d3$,$\\operatorname{MEX}\\{1,2,3\\}\u003d0$)\u003c/p\u003e\u003ch3\u003e输入格式\u003c/h3\u003e\u003cp\u003e第一行两个整数 $n,m$,表示序列长度和数集大小。\u003c/p\u003e\u003cp\u003e第二行 $n$ 个整数,表示序列 $a$,且保证序列 $a$ 中元素在 $[0,m)$ 范围内。\u003c/p\u003e\u003cp\u003e第三行两个整数 $p,q$,表示小 $\\mathcal{L}$ 要查询的范围。\u003c/p\u003e\u003ch3\u003e输出格式\u003c/h3\u003e\u003cp\u003e一行 $q-p+1$ 个整数,其中第 $i$ 个表示有多少个区间 $[l,r]$ 中的元素构成的集合的 $\\operatorname{MEX}$ 为 $q+i-1$。\u003c/p\u003e\u003ch3\u003e数据范围\u003c/h3\u003e\u003cp\u003e对于 $10\\%$ 的数据 $n\\leq 233$。\u003c/p\u003e\u003cp\u003e对于 $20\\%$ 的数据 $n\\leq 2333$。\u003c/p\u003e\u003cp\u003e对于 $40\\%$ 的数据 $n\\leq 2\\times 10^5$。\u003c/p\u003e\u003cp\u003e对于另外 $10\\%$ 的数据 $q-p\\leq 10$。\u003c/p\u003e\u003cp\u003e对于另外 $10\\%$ 的数据 $a_i\u003di\\pmod m$。\u003c/p\u003e\u003cp\u003e对于另外 $10\\%$ 的数据 $n\u003dm$ 且 $[0,m)$ 中的每个值在序列中恰好只出现一次。\u003c/p\u003e\u003cp\u003e对于 $100\\%$ 的数据 $0\\leq p\\leq q\\leq m\\leq n\\leq 10^6$。\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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 5\n2 1 3 0 4\n2 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2 0 1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e\u003cul\u003e\u003cli\u003e区间 $[2, 4]$ 中元素构成的集合 MEX 的值为:$2$;\u003c/li\u003e\u003cli\u003e区间 $[2, 5]$ 中元素构成的集合 MEX 的值为:$2$;\u003c/li\u003e\u003cli\u003e没有区间的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[1, 4]$ 中元素构成的集合 MEX 的值为:$4$;\u003c/li\u003e\u003c/ul\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e6 3\n2 0 2 2 1 0\n2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 6\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e\u003cul\u003e\u003cli\u003e区间 $[5, 6]$ 中元素构成的集合 MEX 的值为:$2$;\u003c/li\u003e\u003cli\u003e区间 $[1, 5]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[1, 6]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[2, 5]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[2, 6]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[3, 6]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003cli\u003e区间 $[4, 6]$ 中元素构成的集合 MEX 的值为:$3$;\u003c/li\u003e\u003c/ul\u003e"}}]}