-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
40 lines (37 loc) · 650 Bytes
/
B.cpp
File metadata and controls
40 lines (37 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
void solve()
{
int n;
cin >> n;
int max_length = 0;
int length =0;
int temp;
for(int i=0;i<n;i++){
cin >> temp;
if(temp == 0){
length++;
}
else{
if(length>max_length){
max_length = length;
}
length = 0;
}
}
if(length>max_length){
max_length = length;
}
length = 0;
cout << max_length << endl;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--)
solve();
}