{"trustable":false,"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":"区间统计是一个很经典的题目!\u003cbr\u003e\n现在我们的任务是,给定一个数组a[n],请你统计L到R中不同数字的个数。"}},{"title":"输入","value":{"format":"HTML","content":"第一行一个整数n,代表数组的长度。\u003cbr\u003e\n第二行一共n个整数,第i个整数代表a[i]。\u003cbr\u003e\n第三行一个整数Q,代表询问的组数。\u003cbr\u003e\n接下来Q行,每行两个整数L、R,含义如上所示。"}},{"title":"输出","value":{"format":"HTML","content":"对于每组询问,输出一行一个数字,代表答案。"}},{"title":"样例输入","value":{"format":"HTML","content":"6\u003cbr\u003e\n1 2 2 3 5 1\u003cbr\u003e\n3\u003cbr\u003e\n1 3\u003cbr\u003e\n1 6\u003cbr\u003e\n2 2"}},{"title":"样例输出","value":{"format":"HTML","content":"2\u003cbr\u003e\n4\u003cbr\u003e\n1"}},{"title":"数据范围","value":{"format":"HTML","content":"n \u003c\u003d 30000,0\u003c\u003da\u003csub\u003ei\u003c/sub\u003e\u003c\u003d1000000,Q\u003c\u003d200000"}}]}