#CCBCHBAHAI0000015. Độ dài đoạn bằng nhau liên tiếp dài nhất (Longest Equal Contiguous Run)
Độ dài đoạn bằng nhau liên tiếp dài nhất (Longest Equal Contiguous Run)
Longest Equal Contiguous Run
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given , find the maximum length of a contiguous segment whose elements are all equal.
Input
Line 1 contains . Line 2 contains .
Output
Print the required integer answer.
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
Example
Input
10
4 4 4 2 2 7 7 7 7 1
Output
4
Explanation
The values follow directly from the definitions and illustrate the valid index range of the array scan.