P3069 [USACO13JAN] Cow Lineup G

题目描述

Farmer John's N cows (1

输入格式

\* Line 1: Two space-separated integers: N and K. \* Lines 2..1+N: Line i+1 contains the breed ID B(i).

输出格式

\* Line 1: The largest size of a contiguous block of cows with identical breed IDs that FJ can create.

说明/提示

There are 9 cows in the lineup, with breed IDs 2, 7, 3, 7, 7, 3, 7, 5, 7. FJ would like to remove up to 1 breed ID from this lineup. By removing all cows with breed ID 3, the lineup reduces to 2, 7, 7, 7, 7, 5, 7. In this new lineup, there is a contiguous block of 4 cows with the same breed ID (7).