https://atcoder.jp/contests/abc210/tasks/abc210_c
题目描述:
There are N candies arranged in a row from left to right. Each of these candies has one color that is one of the 10^9 colors called Color 1, Color 2, ……, and Color 10^9. For each i=1,2,…,N, the color of the ii-th candy from the left is Color ci.
From this row, Takahashi can choose K consecutive candies and get them. That is, he can choose an integer ii such that 1≤i≤N−K+1 and get the i-th, (i+1)-th, (i+2)-th, ……, (i+K−1)-th candy from the left.
Takahashi likes to eat colorful candies, so the more variety of colors his candies have, the happier he will be. Print the maximum possible number of distinct colors in candies he gets.
数据范围:
-
1≤K≤N≤3×10^5
-
1≤ci≤10^9
-
All values in input are integers.