{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cp\u003e某人读一本书,要看完所有的知识点,这本书共有P页,第i页恰好有一个知识点ai,(每一个知识点都有一个整数编号)。全书同一个知识点可能会被提到多次,他希望阅读其中一些连续的页把所有知识点都读到,给定每页所读到的知识点,求最少的阅读页数 .\u003c/p\u003e\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cp\u003eThe first line of input is an integer \u003ci\u003eP\u003c/i\u003e (1 ≤ \u003ci\u003eP\u003c/i\u003e ≤ 1000000), which is the number of pages of Jessica\u0027s text-book. The second line contains \u003ci\u003eP\u003c/i\u003e non-negative integers describing what idea each page is about. The first integer is what the first page is about, the second integer is what the second page is about, and so on. You may assume all integers that appear can fit well in the signed 32-bit integer type.\u003c/p\u003e\n第一行一个整数为书页数P,第二行P个整数为每页的知识点,每个数字表示一个知识点 \n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \u003cp\u003eOutput one line: the number of pages of the shortest contiguous part of the book which contains all ideals covered in the book.\u003c/p\u003e输出最少阅读页数 \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e5\n1 8 8 8 1\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e2\u003c/pre\u003e"}}]}