2099: 最多颜色的车辆

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

在一个狭小的路口,每秒只能通过一辆车,假好车辆的颜色只有 3 种,找出 N 秒内经过的最多颜色的车辆数量。 三种颜色编号为0 ,1 ,2

Input

第一行输入的是通过的车辆颜色信息 [0,1,1,2] 代表4 秒钟通过的车辆颜色分别是 0 , 1 , 1 , 2 第二行输入的是统计时间窗,整型,单位为秒

Output

输出指定时间窗内经过的最多颜色的车辆数量。

Sample Input Copy

0 1 2 1
3

Sample Output Copy

2

Source/Category