CF1829B.Blank Space

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a binary array aa of nn elements, a binary array is an array consisting only of 00 s and 11 s.

A blank space is a segment of consecutive elements consisting of only 00 s.

Your task is to find the length of the longest blank space.

输入格式

The first line contains a single integer tt ( 1t10001 \leq t \leq 1000 ) — the number of test cases.

The first line of each test case contains a single integer nn ( 1n1001 \leq n \leq 100 ) — the length of the array.

The second line of each test case contains nn space-separated integers aia_i ( 0ai10 \leq a_i \leq 1 ) — the elements of the array.

输出格式

For each test case, output a single integer — the length of the longest blank space.

输入输出样例

  • 输入#1

    5
    5
    1 0 0 1 0
    4
    0 1 1 1
    1
    0
    3
    1 1 1
    9
    1 0 0 0 1 0 0 0 1

    输出#1

    2
    1
    1
    0
    3
首页