Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	max, cnt := 0, 0
	for i := 0; i < N; i++ {
		cnt++
		if nextInt() == 0 {
			cnt = 0
		}
		if cnt > max {
			max = cnt
		}
	}
	fmt.Println(max + 1)
}

Python: N=int(input())
A=list(map(int,input().split()))

one_count=0
one_max=0
i=0

for i in range(len(A)):
    if A[i]==1:
        one_count=one_count+1
    else:
        if one_count>one_max:
            one_max=one_count
        one_count=0
if one_count>one_max:
    one_max=one_count

print(one_max+1)

Python: #B
N = int(input())
A = list(map(int,input().split()))
M = 0
count = 0
for a in A:
    if a == 1:
        count+=1
    else:
        M = max(M,count)
        count = 0
M = max(M,count)
print(M+1)

Python: N = int(input())
line = list(map(int,input().split()))
ans = 1
count = 1
for i in range(N):
    if line[i] == 0:
        ans = max(ans,count)
        count = 1
    else:
        count = count + 1
ans = max(ans,count)
print(ans)

Python: n = int(input())

count = 0
max = 0
n = input().split()

for i in range(len(n)):
    if(n[i] == '1'):
        count += 1
    elif(n[i] == '0'):
        count = 0

    if(max < count):
        max = count


print(max+1)

Python: n = int(input())
a = list(map(int,input().split()))

d = 1
m = 1
for i in range(n):
    if a[i] == 1:
        d += 1
        m = max(m,d)
    else:
        d = 1

print(m)

Python: n = int(input())
ms = 1
p = 1
s = input().split()
for i in range(n):
    if s[i] == "1":
        p += 1
    else:
        ms = max(ms, p)
        p = 1
ms = max(ms, p)
print(ms)

Python: n = int(input())

l = list(map(int, input().split()))

cnt=0
maxcnt=0

#print(l[0])

for i in range(0,n):
    if(l[i]==1):
        cnt=cnt+1
        if(cnt>maxcnt):
            maxcnt=cnt
            #print(maxcnt)
    else:
        cnt=0
print(maxcnt+1)

Python: n = int(input())
a = list(map(int, input().split()))
# 1がマックス連続するところ+1の数が出せるサイコロが必要
mx = 0
cnt = 0
for i in a:
    if i == 1:
        cnt += 1
        if mx <= cnt:
            mx = cnt
    else:
        cnt = 0
print(mx+1)

Python: #!/usr/bin/python3

import os
import sys


def main():
    N = read_int()
    A = read_ints()
    print(solve(N, A))


def solve(N, A):
    ans = 1
    i = 0
    while i < N:
        j = i + 1
        while j < N and A[i] == A[j]:
            j += 1
        if A[i] == 1:
            ans = max(ans, j - i + 1)
        i = j
    return ans


###############################################################################

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Python: N = int(input())
A = list(map(int, input().split()))

def long_repeat(line):
    cnt = 1
    max = 1
    if line != "":
        for i in range(1,len(line)):
            if line[i] == line[i-1] and line[i]==1and line[i-1]==1:
                cnt+=1
                if cnt > max:
                    max = cnt
            else:
                cnt = 1
        return max
    else:
        return 0
if sum(A) == 0:
    print(1)
else:
    print(long_repeat(A)+1)

Python: n = int(input())
tmp_list = list(map(int, input().split()))
counter = 0
max_num = 0
for i in range(n):
    if tmp_list[i] == 0:
        max_num = max(max_num, counter)
        counter = 0
    else:
        counter += 1
        
max_num = max(max_num, counter)

print(max_num + 1)

Python: n = int(input())
nlist = list(map(int, input().split()))
def len1(nlist):
    cnt = 0
    c = 0
    for i in nlist:
        if i == 1:
            c += 1
        else:
            c = 0
        cnt = max(cnt, c)
    return cnt+1
print(len1(nlist))

Python: n = int(input())
a = list(map(int, input().split()))
ans, cnt = 0, 0
for i in range(n):
    if a[i] == 1:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans+1)

Python: import sys

input()
a = list(map(int, sys.stdin.readline().split()))

c = 0
ans = 0
for i in a:
    if i == 0:
        ans = max(c, ans)
        c = 0
    else:
        c += 1
if c != 0:
    ans = max(c, ans)
    
print(ans+1)

C++: #include <iostream>

using namespace std;

int main()
{
    int n;
    int a[101];
    int cnt = 0;
    int current = 0;

    cin >> n;

    for (int i = 0; i < n; i++) cin >> a[i];

    for (int i = 0; i < n; i++) {
        if (a[i] == 1) {
            current++;
        }
        else {
            if (cnt < current) {
                cnt = current;
            }
            current = 0;
        }
    }

    if (cnt < current) {
        cnt = current;
    }
    cout << cnt + 1 << endl;
}

C++: #include<cstdio>
using namespace std;
int main()
{
	int n,a[100],i,cnt,mx;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	mx=0;
	cnt=0;
	for(i=0;i<n;i++){
		if(a[i]==1){
			cnt++;
			if(mx<cnt){
				mx=cnt;
			}
		}
		if(a[i]==0){
			cnt=0;
		}
	}
	printf("%d\n",mx+1);
	return 0;
}