Problem:


Score : 200 points

Problem Statement

You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.

Here, a ACGT string is a string that contains no characters other than A, C, G and T.

Notes

A substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.

For example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and  (the empty string), but not AC.

Constraints

S is a string of length between 1 and 10 (inclusive).

Each character in S is an uppercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

Print the length of the longest ACGT string that is a substring of S.

Sample Input 1

ATCODER

Sample Output 1

3

Among the ACGT strings that are substrings of ATCODER, the longest one is ATC.

Sample Input 2

HATAGAYA

Sample Output 2

5

Among the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.

Sample Input 3

SHINJUKU

Sample Output 3

0

Among the ACGT strings that are substrings of SHINJUKU, the longest one is  (the empty string).



Sample input:
ATCODER


Sample output:
3

Submission status: Runtime Error

Solution code:
S = input()
atcg = ["A","T","C","G"]
num_lis =[]
for idx,s in enumerate(S):
  if s in atcg:
    num_lis.append(idx)

ans_lis =[]
x = 0

for i in range(len(S)):
  if i in num_lis:
    x += 1
  else:
    ans_lis.append(x)
    x = 0
    
print(max(ans_lis))

Submission status: Runtime Error

Solution code:
s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmaax)

Submission status: Runtime Error

Solution code:
a=0
b=0
for i in range(len(N)):
	if N[i] == 'A' or N[i] ==  'T' or N[i] ==  'C' or N[i] ==  'G' :
		a+=1
	else: 
		if a > b: b = a
		a=0

print(b)

Submission status: Runtime Error

Solution code:
n, q = map(int ,input().split())
s = list(input())
for i in range(q):
    l, r = map(int, input().split())
    ss = ''.join(s[l-1:r])
    ans = ss.count('AC')
    print(ans)

Submission status: Runtime Error

Solution code:
judge = ['A','G', 'C', 'T']
string_list = [i in judge for i in input()]
string = ''.join(string_list).split('False')
print(max([i.count('True') for i in string]))

Submission status: Runtime Error

Solution code:
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(max)

Submission status: Runtime Error

Solution code:
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(count)

Submission status: Runtime Error

Solution code:
#KyoproRの競技プログラミング過去問配信
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
if len(k) == 0:
    print(0)
else:
    print(max(k))

Submission status: Runtime Error

Solution code:
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
print(max(k))

Submission status: Runtime Error

Solution code:
s = input()
k = 0
ans = 0
for i in range(s):
    if s[i] == "A" or "G" or "C" or "T":
        k += 1
    else:
        ans = max(ans, k)
        k = 0
ans = max(ans, k)
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for i in range(len(s)):
  l=0
  for j in range(i:len(s)):
    if s[j] in ["A","T","G","C"]:
      l+=1
    else:
      break
  ans=max(ans,l)
print(ans)

Submission status: Runtime Error

Solution code:
s=input()

arr=[]
tmp=''
for s_ in s:
  if s_ in ('A', 'C', 'G', 'T'):
    tmp+=s_
  else:
    arr.append(len(tmp))
    tmp=''
print(max(arr))

Submission status: Runtime Error

Solution code:
s = input()

c = 0
m = 0
for i in s:
	if s in 'ACGT':
		c += 1
		m = max(c,m)
    else:
		c = 0

print(m)

Submission status: Runtime Error

Solution code:
s = list(input())

cnt = []
c = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i =="T":
        c += 1
    else:
        cnt.append(c)
        c = 0

print(max(cnt))

Submission status: Runtime Error

Solution code:
s = list(input())

cnt = []
c = 0
for i in s:
    print(i)
    if i == "A" or i == "C" or i == "G" or i =="T":
        c += 1
    else:
        cnt.append(c)
        c = 0

print(max(cnt))

Submission status: Runtime Error

Solution code:
S=input()
n=len(S)
ans=[]
for i in range(n):
  cnt=0
  for j in range(j,n):
    if S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T':
      cnt+=1
  ans.append(cnt)
print(max(ans))

Submission status: Runtime Error

Solution code:
S=input()
n=len(S)
ans=[]
for i in range(n):
  j=i
  cnt=0
  while(S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T'):
    cnt+=1
    j+=1
  ans.append(cnt)
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
cnt = 0
cnt_list = []
for i in range(len(s)):
  if s[i] == "A":
    cnt +=1
  elif s[i] == "C":
    cnt +=1
  elif s[i] == "G":
    cnt +=1
  elif s[i] == "T":
    cnt +=1
  else:
    cnt_list.append(cnt)
    cnt = 0
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
s = input()
cnt = 0
cnt_list = []
for i in range(len(s)):
  if s[i] == "A" or "C" or "G" or "T":
    cnt +=1
  else:
    cnt_list.append(cnt)
  cnt = 0
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
s=input()
a,b=0
for i in s:
  if i in "ATGC" :
    a+=1
  else:
    b=max(a,b)
    a=0
print(max(a,b))

Submission status: Runtime Error

Solution code:
s=input()
a=0
for i in s:
  if i in "ATGC" :
    a+=1
  else:
    b=a
    a=0
print(max(a,b))

Submission status: Runtime Error

Solution code:
s=input()
a=0
for i in s:
  if i in ATGC:
    a+=1
  else:
    b=a
    a=0
print(max(a,b))

Submission status: Runtime Error

Solution code:
s=list(map(str,input().split()))
a=0
for i in s:
  if i in ATGC:
    a+=1
  else:
    b=a
    a=0
print(max(a,b))

Submission status: Runtime Error

Solution code:
S = input()
r = 0
L = []
for c in S:
  if c == "A" or c == "C" or c == "G" or c == "T":
    r += 1
  else:
    L.append(r)
    r = 0
print(max(L))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

s = input()
ans = 0
for i in range(n):
  for j in range(i, n):
    if all('ACGT'.count(c) == 1 for c in s[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

s = input()
ans = 0
for i in range(n):
  for j in range(i, n):
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)

Submission status: Runtime Error

Solution code:
s=list(input())
cnt=0
ans=0
lis=list("ATCG")

for i in s:
  if s[i] in lis:
    cnt+=1
    ans=max(ans,cnt)
  else:
    cnt=0
print(ans)

Submission status: Runtime Error

Solution code:
s=list(input())
cnt=0
ans=0
lis=["ATCG"]

for i in range(len(s)):
  if s[i] in lis:
    cnt+=1
    ans=max(ans,cnt):
  else:
    cnt=0
print(ans)

Submission status: Runtime Error

Solution code:
s = list(input())
lst = []
ans = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        ans += 1
    else:
        lst.append(ans)
        ans = 0
print(max(lst))

Submission status: Runtime Error

Solution code:
s = input()
li = ["A", "T", "G", "C"]
count = 0
ans = []
for i in range(len(s)):
    if s[i] in li:
        count += 1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
ans = []
acgt = ["A", "C", "G", "T"]

cnt = 0
for i in range(len(s)):
    if s[i] in acgt:
        cnt += 1
    else:
        ans.append(cnt)
        cnt = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
acgt = {'A', 'C', 'G', 'T'}
count = 0
temp_list= []

for c in s:
  if c in acgt:
    count += 1
  else:
    temp_list.append(count)
    count = 0

print(max(temp_list))

Submission status: Runtime Error

Solution code:
#ABC 122, B - ATCoder
S = input()
N = len(S)

ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i:j+1])
            ans = max(ans, j - i + 1)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
l = re.findall(r'[ACGT]+', S)
if l:
  print(max(map(len, l)))
else:
  print(0)

Submission status: Runtime Error

Solution code:
import re

S = input()
m = max(map(len, re.findall(r'[ACGT]+', S)))
print(m)

Submission status: Runtime Error

Solution code:
s = input()
correct_list = ["A","C","G","T"]
x_list = [-1]

for i, c in enumerate(s):
    if c not in correct_list:
        x_list.append(i)
diff_list = []
for i in range(len(x_list)-1):
    diff_list.append(x_list[i+1]-x_list[i])
print(max(diff_list)-1)

Submission status: Runtime Error

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    S= list(sys.stdin.readline().rstrip())
    l = ["A","C","G","T"]

    c=0
    c_l=[]
    for e in S:
        if e in l:
            c+=1
        else:
            c_l.append(c)
            c=0

    print(max(c_l))

Submission status: Runtime Error

Solution code:
rec = []
cnt = 0
S_arr = [S for S in input()]
for i in range(len(S_arr)):
    if S_arr[i] == 'A' or S_arr[i] == 'T' or S_arr[i] == 'C' or S_arr[i] == 'G':
        cnt += 1
    elif cnt > 0 and S_arr[i] != 'A'or S_arr[i]!='T'or S_arr[i]!='C'or S_arr[i]!='G':
        rec.append(cnt)
        cnt = 0
rec_sort = sorted(rec)
print(rec_sort[len(rec) - 1])

Submission status: Runtime Error

Solution code:
S = list(input())
ans = []
count = 0
for i in range(len(S)):
    if S[i]=='A' or S[i]=='T' or S[i]== 'C' or S[i]== 'G':
        count += 1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
https://atcoder.jp/contests/abc128/tasks/abc128_a

Submission status: Runtime Error

Solution code:
S = input()
n = []
k=0
for c in S:
    if c in 'ACGT':
        k+=1
    elif k>0:
        n.append(k)
        k=0
if k>0: n.append(k)

print(max(n))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
li = ["A", "C", "G", "T"]
count = 0
for i in s:
    if i in li:
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0
if count == len(ans):
    print(count)
else:
    print(ans)

Submission status: Runtime Error

Solution code:
S = input()

def AGCT(S,i):
    if S[i] == "A" or S[i] == "T" or S[i] == "G" or S[i] == "C":
        return 0
    else:
        return 1

c = 0
ANS = []
for i in range(len(S)):
    if AGCT(S,i) == 0:
        c += 1
    else:
        ANS.append(c)
        c = 0
print(max(ANS))

Submission status: Runtime Error

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = list(inputs[0])
    ACGT = {"A", "C", "G", "T"}

    max_length = 0
    for i in range(0, len(S)):
        length = 0
        j = i
        while S[j] in ACGT and j < len(S):
            length += 1
            j += 1
        max_length = length if length > max_length else max_length
    return max_length


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Runtime Error

Solution code:
S=list(input())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
print(max(li2))
print(li2)

Submission status: Runtime Error

Solution code:
S=list(input())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
print(max(li2))

Submission status: Runtime Error

Solution code:
def main():
    S = input()

    acgt = []
    flag = False
    count = 0
    for s in S:
        if s == "A" or s == "C" or s == "G" or s == "T":
            if flag:
                count += 1
            else:
                flag = True
                count = 1
        else:
            acgt.append(count)
            flag = False
            count = 0

    print(max(acgt))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s = input()

count = 0
ans = []
for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0
print(max(lengths))

Submission status: Runtime Error

Solution code:
S = list(input())
acgt = ['A','C','G','T']
lengths = []
length = 0
for s in S:
  if s in acgt:
    length+=1
  else:
    lengths.append(length)
print(max(lengths))

Submission status: Runtime Error

Solution code:
s=input()
list=["A","C","G","T"]
new=[]
a=0
for i in s:
  if i in list:
    a+=1
  if i not in list:
    new.append(a)
    a=0
print(max(new))

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
at=["A","T","G","C"]
ans=[-1]
for i in range(n):
    if s[i] not in at:
        ans.append(i)#-ans[-1])
m=len(ans)
ans2=[]
for j in range(m-1):
    ans2.append(ans[j+1]-ans[j]-1)
#print(ans2)    
print(max(ans2))

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
at=["A","T","G","C"]
ans=[-1]
for i in range(n):
    if s[i] not in at:
        ans.append(i)#-ans[-1])
m=len(ans)
ans2=[]
for j in range(m-1):
    ans2.append(ans[j+1]-ans[j])
print(ans)    
print(max(ans2)-1)

Submission status: Runtime Error

Solution code:
count = 0
c = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count += 1
  else:
    c.append(count)
    count = 0

print(max(c))

Submission status: Runtime Error

Solution code:
#HATAGAYA
count = 0
c = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count += 1
  else:
    c.append(count)
    count = 0
print(max(c))

Submission status: Runtime Error

Solution code:
#HATAGAYA
words = ''
w = []
flag = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    flag.append('True')
  else:
    flag.append('False')

for j in range(len(S)):
  if flag[j] == 'True':
  	words += S[j]
  elif flag[j] == 'False':
    w.append(words)
    words = ''

print(len(max(w)))

Submission status: Runtime Error

Solution code:
words = ''
w = []
flag = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    flag.append('True')
  else:
    flag.append('False')

for j in range(len(S)):
  if flag[j] == 'True':
  	words += S[j]
  elif flag[j] == 'False':
    w.append(words)
    words = ''

print(len(max(w)))

Submission status: Runtime Error

Solution code:
words = ''
w = []
flag = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    flag.append('True')
  else:
    flag.append('False')
print(S)
print(flag)

for j in range(len(S)):
  if flag[j] == 'True':
  	words += S[j]
  elif flag[j] == 'False':
    w.append(words)
    words = ''

print(len(max(w)))

Submission status: Runtime Error

Solution code:

s = input()
ls = len(s)
part_s = set( [s[i:j+1] for i in range(ls) for j in range(ls)  ])
part_s = [ i for i in part_s if set(list(i)) | set(["A","T","C","G"]) == set(["A","T","C","G"])]
print(max(map(len,part_s)))

Submission status: Runtime Error

Solution code:
s=input()
x=['A','T','C','G']
a=[0]*len(s)
a[0]=1 if s[0] in x
for i in range(1,len(s)):
  if s[i] in x:
    a[i]=a[i-1]+1
print(max(a))

Submission status: Runtime Error

Solution code:
s = input()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
print(max(num))

Submission status: Runtime Error

Solution code:
s = input()
z = ''
ans = ''
for i in range(len(s)):
  if s[i] in 'ACGT':
    z = s[i]
	for j in range(i+1, len(s)):
      if s[j] in 'ACGT':
        z += s[j]
      else:
        if len(s) > len(ans):
          ans = s
        z = ''
  else:
    continue
print(ans)

Submission status: Runtime Error

Solution code:
# AtCorder

s = input() + ""

a = "ACGT"
v = 0
ans = []

for i in s:
    if i in a:
        v += 1
    else:
        if v != 1:
            ans.append(v)
        v = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
# AtCorder

s = input()

a = "ACGT"
v = 0
ans = []

for i in s:
    if i in a:
        v += 1
    else:
        if v != 1:
            ans.append(v)
        v = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
# AtCorder

s = input()

a = ["A","C","G","T"]
ans = []
v = 0
for i in s:
    if i in a:
        v += 1
    else:
        if v != 1:
            ans.append(v)
        v = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
# AtCorder

s = input()

a = ["A","C","G","T"]
ans = []
v = 0
for i in s:
    if i in a:
        v += 1
    else:
        ans.append(v)
        v = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in a:
  　　　　if i in 'ATGC':
    　　　　　　　num+=1
  　　　　else:
    　　　　　　　b.append(num)
    　　　　　　　num=0
print(max(b))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in a:
  if a in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in a:
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Submission status: Runtime Error

Solution code:
a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i]　in "ATGC":
    num=1
  else:
    b.appendS(num)
    num=0
print(max(b))

Submission status: Runtime Error

Solution code:
s = input()
a = 0
b = 0
for i in len(s):
    if i in 'ATGC':
        a += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

Submission status: Runtime Error

Solution code:
s = input()
a = 0
b = 0
for i in len(s):
    if i in 'ATGC':
        ans += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
alst = []
for i in s:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        ans += 1
    else:
        alst.append(ans)
        ans = 0
        continue

print(max(alst))

Submission status: Runtime Error

Solution code:
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] = 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i, n):
        if all('ACGT'.count(c) == 1 for c in s[i + j +1]):
            ans = max(ans, j-i+1)
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
cnt = 0
cnt_list = [0]*len(s)
for i in s:
    if s in 'ACTG ':
        cnt +=1
    else:
        cnt = 0
    cnt_list[i] = cnt
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
s = input()
lis=[]
for i in range(len(s)):
    if s[i] not in "ACGT":
        lis.append(i)
len_max = 0
for i in range(len(lis)-1):
    len_max = max(len_max,lis[i+1]-lis[i]-1)
print(max(len_max,lis[0],len(s)-lis[-1]-1))

Submission status: Runtime Error

Solution code:
s = input()
slt = list(s)

mojiretu = ["A", "C", "G", "T"]

cntlt = list()
cnt = 0
for i in range(0, len(slt)):
    if slt[i] in mojiretu:
        cnt += 1
    else:
        cntlt.append(cnt)
        cnt = 0

print(max(cntlt))

Submission status: Runtime Error

Solution code:
s = list(input())
acgt = ['A','C','G','T']
tmp = ''
ans = []
for i in range(len(s)):
    if s[i] in acgt:
        tmp+=s[i]
    else:
        ans.append(tmp)
        tmp = ''
if max(ans)==0:
    print(0)
else:
    print(len(max(ans)))

Submission status: Runtime Error

Solution code:
s = list(input())
acgt = ['A','C','G','T']
tmp = ''
ans = []
for i in range(len(s)):
    if s[i] in acgt:
        tmp+=s[i]
    else:
        ans.append(tmp)
        tmp = ''
print(len(max(ans)))

Submission status: Runtime Error

Solution code:
<?php

$s = trim(fgets(STDIN));
$count = [0];

$replace = preg_replace('/[^ACGT]/',',',$s);
$matchs = array_filter(explode(',',$replace));

foreach ($matchs as $m) {
    $count[] = strlen($m);
}

print(max($count) . "\n");

Submission status: Runtime Error

Solution code:
S = input()

ATCG = ['A','T','C','G']
ans = []
pre = 0
for s in S:
    if s in ATCG:
        pre += 1
    else:
        ans.append(pre)
        pre = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()

cnt = 0
ans = 0

for ss in S:
    if ss in 'ACGT':
        len += 1
    else:
        len = 0
    ans = max(ans,len)
    
print(ans)

Submission status: Runtime Error

Solution code:
S = input()

candidates = []

tmp = []

for char in S:
    if char in ["A", "T", "G", "C"]:
        tmp.append(char)
    else:
        candidates.append(tmp)
        tmp = []
        
sorted_candidates = sorted(candidates, reverse=True, key=lambda x: len(x))
print(len(sorted_candidates[0]))

Submission status: Runtime Error

Solution code:
S = input()
list = []
counter = 0
H = []
c = []
d = 0
j=0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
        j=0
    else:
        H.append(i)
for i in range(len(H)-1):
    d = H[i+1]-H[i]-1
    c.append(d)
c.append(H[0])
print(max(c))

Submission status: Runtime Error

Solution code:
S=input()
H=[]
M=len(S)
an=[]
j=0
for i in range(M):
	if S[i]=="A":
	elif S[i]=='C':
	elif S[i]=='G':
	elif S[i]=='T':
	else:
		H.append(i)
N=len(H)    
for i in range(N)
   an=H[i+1]-H[i]+1
an.append(H[0])

c=Max(an)
print("%d"% c)

Submission status: Runtime Error

Solution code:
s = input()

ans = []
lst = ['A','T','C','G']
n = 0
for i in s:
    if i in lst:
        n = n + 1
    else:
        ans.append(n)
        n = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()

cnt = 0
q = []
now = 0

for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'C' or s[i] == 'G':
        cnt += 1
    else:
        q.append(cnt)
        cnt = 0

print(max(q))

Submission status: Runtime Error

Solution code:
s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(I):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
list = []
counter = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
        counter += 1
    else:
        list.append(counter)
        counter = 0
print(max(list))

Submission status: Runtime Error

Solution code:
import re

S = input()

print(len(max(re.findall('[ATCG]+', S))))

Submission status: Runtime Error

Solution code:
import re

S = input()

print(max(re.findall('[ATCG]+', S)))

Submission status: Runtime Error

Solution code:
s = list(input())
cnt = 0
list = []
for i in range(len(s)):
    if s[i] in ['A','C','G','T']:
        cnt += 1
    else:
        if cnt > 0:
            list.append(cnt)
            cnt = 0
if not cnt == 0:
    list.append(cnt)
max = max(list)
print(max)

Submission status: Runtime Error

Solution code:
s = list(input())
cnt = 0
list = []
for i in range(len(s)):
    if s[i] in ['A','C','G','T']:
        cnt += 1
    else:
        list.append(cnt)
        cnt = 0
max = max(list)
print(max)

Submission status: Runtime Error

Solution code:
S = list(input())
n = []
a = 0
for s in S :
	if s in ["A","T","G","C"] :
		a += 1
	else :
		n.append(a if a > 0 else 0)
		a = 0
print(max(n))

Submission status: Runtime Error

Solution code:
str = input()
S = list(str)

ans = 0
num = 0

for i in range(len(str)):
  if list[i] == "A" or list[i] == "G" or list[i] == "T" or list[i] == "C":
    num = 1
    for j in range(len(str)):
      if list[j] == "A" or list[j] == "G" or list[j] == "T" or list[i] == "C":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)

Submission status: Runtime Error

Solution code:
str = input()
S = list(str)

ans = 0
num = 0

for i in range(len(str)):
  if list[i] == "A" or list[i] == "G" or list[i] == "T" or list[i] == "C":
    num = 1
    for j in range(len(str)):
      list[j] == "A" or list[j] == "G" or list[j] == "T" or list[i] == "j":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)

Submission status: Runtime Error

Solution code:
S = input()

counts = []
count = 0
for s in S:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        count += 1
    else:
        counts.append(count)
        count = 0

print(max(counts))

Submission status: Runtime Error

Solution code:
S = input()

counts = []
count = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
        continue
    else:
        counts.append(count)
        count = 0

print(max(counts))

Submission status: Runtime Error

Solution code:
s = input()
max = 0
count = 0

for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        if count > max:
            max = count
            count = 0

print(max(max, count))

Submission status: Runtime Error

Solution code:
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i] in "AGCT":
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)

Submission status: Runtime Error

Solution code:
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)

Submission status: Runtime Error

Solution code:
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i]==A or S[i]==G or S[i]==C or S[i]==T:
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
s1="ATGC"
l=[]
count=0
for i in range(len(s)):
  if s[i] not in s1:
    l.append(count)
    count=0
  else:
    count=count+1
print(max(l))

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(s-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(s-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag:
			ans+=1
			break
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
for length in range(1,len(s)+1):
	for left in range(s-length+1):
		z=s[left:left+length]
		flag=True
		for i in range (length):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag:
			ans+=1
			break
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
m = 0
n = 0
lst = []
for i in range(len(S)):
  n += 1
  if i not in "ACGT":
    lst.append(n)
for y in range(len(lst)-1):
  if (lst[y+1] - lst[y]) > m:
    m = (lst[y+1] - lst[y])
print (m-1)

Submission status: Runtime Error

Solution code:
S = input()
cnt = 0
ans = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt =
ans = max(ans, cnt)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
acgt = ["A", "C", "G", "T"]
ans = []
count = 0
for s in S:
  if s in acgt:
    count += 1
  else:
    ans.append(count)
    count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ["A", "C", "G", "T"]
count = 0
mx = 0
if S[0] in ACGT:
    count += 1
if len(S) >= 2:
    for i in range(len(S)-1):
        if S[i] in ACGT and S[i+1] in ACGT:
            count += 1
        else:
            ans = max(mx, count)
            count = 0
            mx = ans
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ["A", "C", "G", "T"]
count = 0
mx = 0
if S[0] in ACGT:
    count += 1
for i in range(len(S)-1):
    if S[i+1] in ACGT:
        if S[i] in ACGT:
            count += 1
        else:
            count = 1
    else:
        ans = max(mx, count)
        count = 0
        mx = ans
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ["A", "C", "G", "T"]
count = 0
mx = 0
if S[0] in ACGT:
    count += 1
for i in range(len(S)-1):
    if S[i+1] in ACGT:
        if S[i] in ACGT:
            count += 1
    else:
        ans = max(mx, count)
        count = 0
        mx = ans
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
acgt='ACGT'

x = 0; l=[]
for c in s:
    if c in acgt:
        x += 1
    else:
        l.append(x)
        x = 0
print(max(l))

Submission status: Runtime Error

Solution code:
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if str(s[i]) in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

Submission status: Runtime Error

Solution code:
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if s[i] in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)