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: Wrong Answer

Solution code:
S = input()
s = []
a = 1
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        s.append(i)
if len(s) == 0:
    print(0)
    exit()
for j in range(len(s) - 1):
    if s[j] + 1 == s[j + 1]:
        a += 1
print(a)

Submission status: Wrong Answer

Solution code:
s = list(input())
c = int(0)
result = int(0)

for i in s:
        if(i=="A" or i=="C" or i=="G" or i=="T"):
                c+=1
        else:
                if(c>result):
                        result = c
                c=0

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

ACGT = ['A','C','G','T']

num_list = [0]
for i in range(len(S)):
  if S[i] not in ACGT:
    num_list.append(i)

num_list.append(len(S))

dif_list = []
for i in range(len(num_list)-1):
  dif_list.append(num_list[i+1]-num_list[i])
  
print(max(dif_list)-1)

Submission status: Wrong Answer

Solution code:
S = input()

ACGT = ['A','C','G','T']

num_list = [0]
for i in range(len(S)):
  if S[i] not in ACGT:
    num_list.append(i)

num_list.append(len(S)+1)

dif_list = []
for i in range(len(num_list)-1):
  dif_list.append(num_list[i+1]-num_list[i])
  
print(max(dif_list)-1)

Submission status: Wrong Answer

Solution code:
s = input()
word = ['A','T','G','C']
m = 0
cnt = 0
for i in range(len(s)):
    if s[i] in word:
        cnt += 1
    elif i==len(s) and cnt>m:
        m=cnt
    elif cnt>m:
        m=cnt
    else:
        cnt=0
print(m)

Submission status: Wrong Answer

Solution code:
a = input()
maxima=0
c=0
for i in range(0,len(a)):
	if(a[i:i+1]=="A" or a[i:i+1]=="T" or a[i:i+1]=="G" or a[i:i+1]=="C"):
		c=c+1
	else:
		if(c>maxima):
			maxima=c
			c=0
		else:
			c=0
print(maxima)

Submission status: Wrong Answer

Solution code:
str = input()
s = [x for x in str]
for i in range(len(s)):
    if s[i] in ["A","C","T","G"]:
        s[i] = "l"
    else:
        s[i] = "o"

ans = 0
temp = 0
for i in range(len(s)):
    if s[i]=="l":
        temp += 1
    else:
        if temp > ans:
            ans = temp
            temp = 0
        else:
            temp = 0
            
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
count=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":
        count+=1
    else:
        if count>ans:
            ans=count
        count=0
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if s[i] in "ACGT":
        s = s.replace(s[i],"1")
    else:
        s = s.replace(s[i],"0")

ans = 0
temp = 0
for i in range(len(s)):
    if s[i]=="1":
        temp += 1
    else:
        if temp > ans:
            ans = temp
            temp = 0
        else:
            temp = 0
            
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)


AGTC = ['A', 'G', 'T', 'C']
part_l = []
for i in range(N):

        if S[i] in AGTC:
                if i == 0:
                        part = [S[i]]
                elif S[i-1] in AGTC:
                        part.append(S[i])
                else:
                        part = [S[i]]
        else:
                if i == 0:
                        part = []
                elif S[i-1] in AGTC:
                        part_l.append(part)
                        part = []
part_l.append(part)

print(part_l)
max_part = []          
for part in part_l:
        if len(part) > len(max_part):
                max_part = part

print(len(max_part))

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)


AGTC = ['A', 'G', 'T', 'C']
part_l = []
for i in range(N):

        if S[i] in AGTC:
                if i == 0:
                        part = [S[i]]
                elif S[i-1] in AGTC:
                        part.append(S[i])
                else:
                        part = [S[i]]
        else:
                if i == 0:
                        part = []
                elif S[i-1] in AGTC:
                        part_l.append(part)
                        part = []

max_part = []          
for part in part_l:
        if len(part) > len(max_part):
                max_part = part

print(len(max_part))

Submission status: Wrong Answer

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)
        count = 0
else:
    num.append(count)
print(max(num))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
result = 0
cnt = 0
b = list(input())
for str in b:
    result = max(result,cnt)
    if str == "A" or str == "T" or str == "C" or str == "G":
        cnt += 1
    else:
        cnt = 0
print(result)

Submission status: Wrong Answer

Solution code:
result = 0
cnt = 0
b = list(input())
for str in b:
    if str == "A" or str == "T" or str == "C" or str == "G":
        cnt += 1
    else:
        result = max(result,cnt)
        cnt = 0
print(result)

Submission status: Wrong Answer

Solution code:
result = 0
cnt = 0
b = list(input())
for str in b:
    if str == "A" or b == "T" or b == "C" or b == "G":
        cnt += 1
    else:
        result = max(result,cnt)
        cnt = 0

Submission status: Wrong Answer

Solution code:
result = 0
cnt = 0
b = list(input())
for str in b:
    if b == "A" or b == "T" or b == "C" or b == "G":
        cnt += 1
    else:
        result = max(result,cnt)
        cnt = 0

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
ret = 0

for i in range(N):
    for j in range(i + 1, N):
        f = True
        for s in S[i:j]:
            if s not in 'ACGT':
                f = False
                break

        if f:
            ret = max(ret, j - i)

print(ret)

Submission status: Wrong Answer

Solution code:
X = list(input())
#print(X)
ans=0
anss=[]
for i in X:
  if i in ['A','C','G','T']:
    ans+=1
    anss.append(ans)
  else:
    break
ans = 0
  
if anss:
  print(max(anss))
else:    
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
# print(S)
# print(len(S))
list = []
for i in range(len(S)):
    if(S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T"):
        list.append(i)
# print(list)
NUM = []
for j in range(len(list)):
    num = 1
    for k in range(len(list) - j -1):
        # print("k:",k)
        if(list[k+1] - list[k] == 1):
            num += 1
            # print("k1:",k)
    else:
        NUM.append(num)
# print(NUM)
if(len(NUM) == 0):
    print(0)
else:
    print(max(NUM))

Submission status: Wrong Answer

Solution code:
S = input()
# print(S)
# print(len(S))
list = []
for i in range(len(S)):
    if(S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T"):
        list.append(i)
# print(list)
NUM = []
for j in range(len(list)):
    num = 1
    for k in range(len(list) - j - 1):
        # print("k",k)
        if(list[k+1] - list[k] == 1):
            num += 1
            # print("k1:",k)
        else:
            NUM.append(num)
# print(NUM)
if(len(NUM) == 0):
    print(0)
else:
    print(max(NUM))

Submission status: Wrong Answer

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
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: Wrong Answer

Solution code:
import math
S = input()
l = len(S)
cs = ["A","G","C","T"]
ma = 0
for i in range (l):
    for j in range(i,l):
        sub = S[i:j]
        for c in sub:
            if c not in cs:
                break
        else:
            if len(sub) > ma:
                ma = len(sub)
print(ma)

Submission status: Wrong Answer

Solution code:
s = input()
s = list(s)
ans = 0
maxlen = 0
acgt = []

for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        acgt.append(s[i])
        ans = len(acgt)
    if ans > maxlen:
        ans = maxlen

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
s = list(s)
ans = 0
acgt = []

for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        acgt.append(s[i])
        ans = len(acgt)

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
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
    else:
        if count>ans:
            ans=count
            count=0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)

def judge(g):
	b = 0
	if sorted(set(list(g+"ACGT"))) == ["A","C","G","T"]:
		b = len(g)
	return b

ans = 0
for i in range(n):
	for j in range(i,n):
		ans = max(ans,judge(s[i:j]))


print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)

def judge(g):
	b = 0
	if sorted(set(list(g+"ACGT"))) == ["A","C","G","T"]:
		b = len(g)
	return b

ans = 0
for i in range(n):
	for j in range(i,n-1):
		ans = max(ans,judge(s[i:j+1]))


print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
a = 0
ans = 0
for i in s:
  if i in 'ATCG':
    a += 1
  else:
    if a > ans :
      ans = a
      a = 0
    a = 0
print(ans)

Submission status: Wrong Answer

Solution code:
b=input()
num=0

for i in b:
    if(i=="A"):
        num+=1
    elif(i=="T"):
        num+=1
    elif(i=="G"):
        num+=1
    elif(i=="C"):
        num+=1


print(num)

Submission status: Wrong Answer

Solution code:
acgt = "ACGT"
S = input()
ans = 0
s = 0
for c in S:
    if c in acgt:
        s += 1
    else:
        ans = max(ans, s)
        s = 0

print(ans)

Submission status: Wrong Answer

Solution code:
mx = 0
S = input()
tmp = 0
for ch in S:
    if ch in "ATCG":
        tmp += 1
    else:
        mx = max(tmp, mx)
        tmp = 0

print(mx)

Submission status: Wrong Answer

Solution code:
import sys
import re

S=input()
if S.isalpha():

    pattern='[A,T,C,G][A,T,C,G][A,T,C,G][A,T,C,G]*'
    match_list=re.findall(pattern, S)
    if match_list:
        size_str=[]
        for item in match_list:
            size_str.append(len(item))
        print(max(size_str))

    else:
        pattern='[A,T,C,G][A,T,C,G][A,T,C,G]'
        match_list=re.findall(pattern, S)
        if match_list:
            print("3")
            print(match_list)
        else:
            pattern='[A,T,C,G][A,T,C,G]'
            match_list=re.findall(pattern, S)
            if match_list:
                print("2")
                print(match_list)
            else:
                pattern='[A,T,C,G]'
                match_list=re.findall(pattern, S)
                if match_list:
                    print("1")
                    print(match_list)

                else:
                    print("0")

Submission status: Wrong Answer

Solution code:
import sys
import re

S=input()
pattern='[A,T,C,G][A,T,C,G][A,T,C,G][A,T,C,G]*'
match_list=re.findall(pattern, S)
if match_list:
    size_str=[]
    for item in match_list:
        size_str.append(len(item))
    print(max(size_str))


elif match_list==0:
    pattern='[A,T,C,G][A,T,C,G][A,T,C,G]'
    match_list=re.findall(pattern, S)
    print("3")

elif match_list==0:
    pattern='[A,T,C,G][A,T,C,G]'
    match_list=re.findall(pattern, S)
    print("2")

elif match_list==0:
    pattern='[A,T,C,G]'
    match_list=re.findall(pattern, S)
    print("1")

else:
    print("0")

Submission status: Wrong Answer

Solution code:
S = input()
str_list = ['A','C','G','T']
cnt = 0
ans = 0

for i in range(len(S)-1):
    for j in range(i,len(S)):
        if S[j] in str_list:
            cnt += 1
        else:
            break
    ans = max(ans,cnt)
    cnt = 0
        
print(ans)

Submission status: Wrong Answer

Solution code:
b = input()
len = len(b)
ACGT = 0
MAX = 0
flag = 0
for i in range(len):
  if b[i]=="A" or b[i]=="C" or b[i]=="G" or b[i]=="T":
    ACGT += 1
  else:
    if MAX < ACGT:
      MAX = ACGT
    ACGT = 0
    flag = 1
  if flag ==0:
    MAX=ACGT
print(MAX)

Submission status: Wrong Answer

Solution code:
S = input()
ans = []
for i in range(1, len(S)):
    if S[i-1] == "A" or S[i-1] == "T" or S[i-1] == "C" or S[i-1] == "G":
        if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
            ans.append(S[i-1])
        else:
            ans.append(S[i-1])
            break
print(len(ans))

Submission status: Wrong Answer

Solution code:
search_char = ('A', 'T', 'G', 'C')
ans = 0
start_flg = False
input_str = input()
for c in input_str:
    if c in search_char:
        # print(c)
        ans += 1
        start_flg = True
    elif c not in search_char and start_flg is True:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
search_char = ('A', 'T', 'G', 'C')
ans = 0
start_flg = False
input_str = input()
for c in input_str:
    if c in search_char:
        # print(c)
        ans += 1
        start_flg = True
    elif start_flg is True:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
b = input()
dna ={"A", "T", "C", "G"}

ans = 0
flag = 0
for i in range(len(b)):
    if set(b[i]) <= dna:
        ans += 1
        for j in range(i+1, len(b)):
            if set(b[j]) <= dna:
                ans += 1
            else:
                flag += 1
                break
    if flag == 1:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
b = input()
dna ={"A", "T", "C", "G"}

ans = 0
flag = 0
for i in range(len(b)):
    if set(b[i]) <= dna:
        ans += 1
        for j in range(i+1, len(b)-i-1):
            if set(b[j]) <= dna:
                ans += 1
        else:
            flag = 1
            break
    if flag == 1:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
ans = []
for i in range(len(S)):
    if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
        ans.append(S[i])

if ans == []:
    print(0)
else:
    print(len(ans))

Submission status: Wrong Answer

Solution code:
b = input()
dna ={"A", "T", "C", "G"}

ans = 0
flag = 0
for i in range(len(b)):
    if set(b[i]) <= dna:
        ans += 1
        for j in range(i+1, len(b)-i):
            if set(b[j]) <= dna:
                ans += 1
        else:
            flag =1
            break
    if flag ==1:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import re

S=input()
S2=re.sub(r'[^AGCT]', '.', S)
a=max(list(map(str, S2.split('.'))))

print(len(a))

Submission status: Wrong Answer

Solution code:
s = input()
a = ["A","C","G","T"]
b = [0]
count = 0

for i in s:
    if i in a:
        count += 1
    else:
        b.append(count)
        count = 0
print(max(b))

Submission status: Wrong Answer

Solution code:
S = input()

c_max = 0
cnt = 0

for i in S:
    if i == "A" or i== "C" or i ==  "G" or i == "T":
        cnt +=1
    else:
        c_max = max(c_max, cnt)
        cnt = 0

print(c_max)

Submission status: Wrong Answer

Solution code:
S = input()

c_max = 0
cnt = 0

for i in S:
    if i == "A" or "C" or "G" or "T":
        cnt +=1
    else:
        c_max = max(c_max, cnt)
        cnt = 0

print(c_max)

Submission status: Wrong Answer

Solution code:
S = input()

ATCG = ['A','T','C','G']
ans = [0, 0]
for s in S:
    if s in ATCG:
        ans[0] += 1
    else:
        if ans[1] < ans[0]:
            ans[1] = ans[0]
        ans[0] = 0

print(ans[1])

Submission status: Wrong Answer

Solution code:
S = input()
cnt = 0
max_cnt = 0

for s in S:
    if s=="A" or s=="C" or s=="G" or s=="T":
        cnt += 1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
        cnt = 0
        
print(max_cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = []
for i in range(len(S)):
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    ans.append(S[i])

print(len(ans))

Submission status: Wrong Answer

Solution code:
code = input()
read_code = list(code)
count = 0
count_end = 0

for i in range(0, len(read_code)):
    code_count = False
    if read_code[i] == "A" or read_code[i] == "C" or read_code[i] == "G" or read_code[i] == "T":
        code_count = True
    else:
        code_count = False
        count_end = count
        count = 0

    if(code_count == True):
        count += 1

print(count_end)

Submission status: Wrong Answer

Solution code:
code = input()
read_code = list(code)
count = 0

for i in range(0, len(read_code)):
    code_count = False
    if read_code[i] == "A" or read_code[i] == "C" or read_code[i] == "G" or read_code[i] == "T":
        code_count = True
    else:
        code_count = False

    if(code_count == True):
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
s = input()
s = s[:10]
#print(s)
#print(len(s))
maxlen = 0
ken = 0

for string in s:
	if string == "A" or string == "T" or string == "G" or string == "C":
		ken += 1
	else:
		if maxlen <= ken:
			maxlen = ken
		ken = 0		
print(maxlen)

Submission status: Wrong Answer

Solution code:
s = input()
maxlen = 0
ken = 0

for string in s:
	if string == "A" or string == "T" or string == "G" or string == "C" or string == "a" or string == "t" or string == "g" or string == "c":
		ken += 1
	else:
		if maxlen <= ken:
			maxlen = ken
		ken = 0		
print(maxlen)

Submission status: Wrong Answer

Solution code:
s = input()
maxlen = 0
ken = 0

for string in s:
	if string == "A" or string == "T" or string == "G" or string == "C":
		ken += 1
	else:
		if maxlen < ken:
			maxlen = ken
		ken = 0		
print(maxlen)

Submission status: Wrong Answer

Solution code:
a=input()
l=[]
for i in (list(a)):
  if i=="A" or i=="T" or i=="G" or i=="C":
    l.append(1)
  else:
    l.append(0)
n=""
for i in l:
  n=n+str(i)
m=[0]
for i in range(10):
  if '1'*i in n:
    m.append(i)
print(max(m))

Submission status: Wrong Answer

Solution code:
a=input()
l=[]
for i in (list(a)):
  if i=="A" or i=="T" or i=="G" or i=="C":
    l.append(1)
  else:
    l.append(0)
n=""
for i in l:
  n=n+str(i)
m=[]
for i in range(10):
  if '1'*i in n:
    m.append(i)
print(max(m))

Submission status: Wrong Answer

Solution code:
S = input()
want = ['A', 'C', 'G', 'T']
zero = [i for i in S]
max_count = [0]
previous = 100
for i, s in enumerate(zero):
    if s in want:
         zero[i] = 1
    else:
        zero[i] = 0
for i, one in enumerate(zero):
    if i == 0:
        if one == 1:
            count = 1
        else:
            count = 0
    if one == previous and one == 1:
        count += 1
        max_count.append(count)
    else:
        count = 0
    previous = one
if max(max_count) == 0:
    print(0)
else:
    print(max(max_count)+1)

Submission status: Wrong Answer

Solution code:
S = input()
want = ['A', 'C', 'G', 'T']
zero = [i for i in S]
max_count = [0]
previous = 100
for i, s in enumerate(zero):
    if s in want:
         zero[i] = 1
    else:
        zero[i] = 0
for i, one in enumerate(zero):
    if i == 0:
        if one == 1:
            count = 1
        else:
            count = 0
    if one == previous and one == 1:
        count += 1
        max_count.append(count)
    else:
        count = 0
    previous = one
print(max(max_count)+1)

Submission status: Wrong Answer

Solution code:
s = input()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            break
    else:
        count_max = max(count_max, count_s)
        print(count_max)
        count_s = 0

count_max = max(count_max, count_s)
print(count_max)

Submission status: Wrong Answer

Solution code:
s = input()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            break
    else:
        count_max = max(count_max, count_s)
        count_s = 0

print(count_max)

Submission status: Wrong Answer

Solution code:
S = input()
out = 0
hoge = 0

for k in S:
    if k == "A" or k == "T"or k == "G" or k == "C":
        hoge += 1      
    else:
        if hoge >= out:
            out = hoge
        hoge = 0

print (out)

Submission status: Wrong Answer

Solution code:
S = input()
out = 0
hoge = 0

for k in S:
    if k == "A" or k == "T"or k == "G" or k == "C":
        hoge += 1      
    else:
        if hoge >= out:
            out = hoge
            hoge = 0

print (out)

Submission status: Wrong Answer

Solution code:
s = input()
c = 0
m = 0
for i in range(len(s)):
  if s[i] in 'AGCT':
    c += 1
  else:
    m = max(m,c)
    c = 0
print(m)

Submission status: Wrong Answer

Solution code:
import re

S = input()

if re.findall('[ATCG]+', S):
  print(len(max(re.findall('[ATCG]+', S))))
else:
  print(0)

Submission status: Wrong Answer

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

cnt = 0
tmp = 0
for i in range(len(s)):
  if s[i] in agct:
    tmp = tmp + 1
  else:
    if tmp > cnt:
      cnt = tmp
      tmp = 0

print(cnt)

Submission status: Wrong Answer

Solution code:
import re

S = input()

if re.findall('[ATCG]+', S):
  print(len(max(re.findall('[ATCG]+', S))))
else:
  print('0')

Submission status: Wrong Answer

Solution code:
import re

S = input()

if re.findall('[ATCG]+', S):
  print(len(max(re.findall('[ATCG]+', S))))
else:
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
ans = 0
count = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        count += 1
    else:
        if count > 0:
            ans = max(ans, count)
            count = 0

print(ans)

Submission status: Wrong Answer

Solution code:
a = input()
cnt = 0
ans = 0
for i in a:
	if i == 'A' or i == 'T' or i == 'G' or i == 'C':
		cnt +=1
	else:
		ans = max(ans , cnt)
		cnt =0
		
print(ans)

Submission status: Wrong Answer

Solution code:
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0
if lenth==len(S):
    max=lenth

print(max)

Submission status: Wrong Answer

Solution code:
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
print(S)
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0
if lenth==len(S):
    max=lenth
    
print(max)

Submission status: Wrong Answer

Solution code:
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0

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

print(max)

Submission status: Wrong Answer

Solution code:
# abc122_b
S = input()
max = 0
l = list("ACGT")

for i in range(len(S)):
 if S[i] in l:
  len = 0
  for j in S[i:-1]:
    if j in l:
      len = len + 1
    else:
      break
  if max < len:
   max = len

print(max)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
for i in range(len(S)):
    for j in range(len(S)):
        if i < j:
            OK = True
            for k in range(i, j):
                if not S[k] in "ACGT":
                    OK = False
            if OK:
                ans = max(ans, j-i)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
a = ["A", "C", "G", "T"]
cnt = 0
_max = 0
for c in s:
    if c in a:
        cnt += 1
    else:
        if cnt > _max:
            _max = cnt
        cnt = 0
print(_max)

Submission status: Wrong Answer

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)

Submission status: Wrong Answer

Solution code:
S = input()

cur, max_ = 0, 0
for c in S:
    if c in {'A', 'C', 'G', 'T'}:
        cur += 1
    else:
        max_ = max(cur, max_)
        cur = 0
print(max_)

Submission status: Wrong Answer

Solution code:
a = input()
count = 0
countd=0
for i in a:
    if i in ('A' , 'T' , 'G' , 'C'):
        count+=1
    else:
        if countd < count:
            countd = count
            count = 0
print(countd)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

answer = 0
maybe_answer = 0
for i in range(len(s)):
  if not (s[i] in "BDEFHIJKLMNOPQRSUVWXYZ"):
    maybe_answer += 1
  else:
    answer = max(answer, maybe_answer)
    maybe_answer = 0

print(answer)

Submission status: Wrong Answer

Solution code:
s = input()

answer = 0
maybe_answer = 0
for i in range(len(s)):
  if not (s[i] in "BEFHIJKLMNOPQRSUVWXYZ"):
    maybe_answer += 1
  else:
    answer = max(answer, maybe_answer)
    maybe_answer = 0

print(answer)

Submission status: Wrong Answer

Solution code:
s = input()

answer = 0
maybe_answer = 0
for i in range(len(s)):
  if (s[i] in ["A", "G", "C", "T"]):
    maybe_answer += 1
  else:
    answer = max(answer, maybe_answer)
    maybe_answer = 0

print(answer)

Submission status: Wrong Answer

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

print(mx)

Submission status: Wrong Answer

Solution code:
s = input()

l = [0]
cnt = 0
for i in s:
    if i in 'ATCG':
        cnt += 1
    else:
        if cnt > 0:
            l.append(cnt)
        cnt += 0
l.append(cnt)

print(max(l))

Submission status: Wrong Answer

Solution code:
s = input()

l = [0]
cnt = 0
for i in s:
    if i in 'ATCG':
        cnt += 1
    else:
        if cnt > 0:
            l.append(cnt)
        cnt += 0

print(max(l))

Submission status: Wrong Answer

Solution code:
S = input()
S = S + "w"
m = 0
n = 0
lst = []
for i in 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: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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 = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
max_count = 0
now_count = 0
target = ["A", "C", "G", "T"]
for c in s:
        if(c in target):
                now_count += 1
        else:
                max_count = max(max_count, now_count)
                now_count = 0
print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
tmp=0
acgt="ACGT"
for i in s:
  if i in acgt:
    ans=max(ans,tmp)
    tmp=0
  else:
    tmp+=1
ans=max(ans,tmp)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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