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=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0

for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    max_length=count_length
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
      
print(max_length)

Submission status: Wrong Answer

Solution code:
s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0

for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
      
print(max_length)

Submission status: Wrong Answer

Solution code:
S = input()

max_length = 0
length = 0
for s in S:
    if s in ["A", "C", "G", "T"]:
        length += 1
    else:
        if length > max_length:
            max_length = length
        length = 0
print(max_length)

Submission status: Wrong Answer

Solution code:
import re
S = input()
s = re.split('[ACGT]',S)
print(max(map(len,s)))

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
from itertools import *


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


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


def LS(): return list(sys.stdin.readline().rstrip().split())


s = S()

ans = 0
temp = 0
for s_s in s:
    if s_s in 'ACGT':
        temp += 1
    else:
        ans = max(ans, temp)
        temp = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()

ans=0
memory=0

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

Submission status: Wrong Answer

Solution code:
import re
S = input()
S = re.sub("[ACGT]", "?", S)
ans = 0
cnt = 0
for s in S:
    if s=="?":
        cnt += 1
    else:
        ans = max(cnt, ans)
print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
d=["A","C","G","T"]
ans=0
cnt=0
for c in s:
  if c in d:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    cnt = 0
    maxC = 0
    for s in S:
        if s in "ACGT":
            cnt += 1
        else:
            maxC = max(maxC, cnt)
            cnt = 0
    print(maxC)


resolve()

Submission status: Wrong Answer

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

ans = 0
tmp = 0
for i in range(N):
    if S[i] in {'A','C','G','T'}:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
m = 0
for i in s:
  if i in 'ACGT':
    ans+=i
  else:
    m = max(m, len(ans))
    ans=''
print(m)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
m = 0
for i in s:
  if i==s[0] and i in 'ACGT':
    ans+=i
    continue
  if i in 'ACGT':
    ans+=i
  else:
    m = max(m, len(ans))
    ans=''
print(m)

Submission status: Wrong Answer

Solution code:
s = input()
pre = False
ans = ''
m = 0
for i in s:
  if i==s[0] and i in 'ACGT':
    ans+=i
    pre=True
    continue
  if i in 'ACGT' and pre == True:
    ans+=i
    pre=True
  else:
    pre=False
    m = max(m, len(ans))
    ans=''
print(len(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = raw_input()
a = set(list('ACGT'))
j = 0
i = 0
r = 0
while( j < len(s)):
	if s[j] not in a:
		j += 1
		i = j 
	else:
		while(j < len(s) and s[j] in a): j+=1
		r = max(r, j - i - 1)
		i = j
print r

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','G','T']:
    count = 0
  else:
    count += 1
    if max_count < count:
      max_count = count
print(max_count)

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','D','T']:
    count = 0
  else:
    count += 1
    if max_count < count:
      max_count = count
print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
l = 0
for c in S:
  if c in 'ATCG':
    l += 1
  else:
    ans = max(ans, l)
    l = 0
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

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

start = 0
ans = 0
def answer(start):
    count = 0
    for i in range(start, len(S)):
        global ans
        if S[i] in ACTG:
            count += 1
        else:
            ans = max(ans, count)
            start += 1
            answer(start)
            break
answer(start)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    max_len = 0
    length = 0

    s = list(s)
    s.append('')

    for i in s:
        if i in ['A', 'C', 'G', 'T']:
            length += 1
        else:
            if length > max_len:
                max_len = length
                length = 0


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#<3>
S = input()
result = 0
ans = 0
word = ["A","G","C","T"]
for i in S:
    
    if i in word:
        ans += 1
    else:
        result = max(result,ans)
        ans = 0
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
point = 0

for i in s:
    if i in "ACGT":
        point += 1

print(point)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
DNA = ['A', 'C', 'G', 'T']
count = 0
for c in s:
    if c in DNA:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
ans = 0
for i in range(N):
  for j in range(i+1, N):
    is_ACGT = True
    for k in range(i, j+1):
      if S[k] not in ['A', 'C', 'G', 'T']:
        is_ACGT = False
        break
    if is_ACGT:
      ans = max(ans, j-i+1)

print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
ans=[]
for i in range(n-1):
  for j in range(i+1,n+1):
    part=set(s[i:j])
    flag=True
    for p in part:
      if p not in list('ATGC'):
        flag=False
        break
    if flag==True:
      ans.append(len(s[i:j]))
#print(ans)
if ans:
  print(max(ans))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
ans=[]
for i in range(n-1):
  for j in range(i+1,n+1):
    part=set(s[i:j])
    flag=True
    for p in part:
      if p not in list('ATGC'):
        flag=False
        break
    if flag==True:
      ans.append(len(s[i:j]))
print(ans)
if ans:
  print(max(ans))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
def main():
    ans = []
    s = input()
    count = 0
    for i in s:
        if i in "ATGC":
            count += 1
        else:
            ans.append(count)
    ans.append(count)
    print(max(ans))
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

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

ans = 0
ok = False
tmp = 0
for s in S:
    if not ok:
        if s in acgt:
            ok = True
            tmp += 1
        else:
            pass
    elif ok:
        if s in acgt:
            tmp += 1
        else:
            ok = False
            ans = max(tmp,ans)
            tmp = 0
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


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


def LS(): return list(sys.stdin.readline().rstrip().split())


s = S()

ans = 0
temp = 0
for a in s:
    if a in 'ACGT':
        temp += 1
    else:
        ans = max(ans, temp)
        temp = 0
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)-1):
    for j in range(i+1, len(S)+1):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)

Submission status: Wrong Answer

Solution code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j+1])-P == set():
        count = max(count,j+1-i)
        
print(count)

Submission status: Wrong Answer

Solution code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)

Submission status: Wrong Answer

Solution code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)

Submission status: Wrong Answer

Solution code:
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-set(S) == set():
        count = max(count,j-i-1)
        
print(count)

Submission status: Wrong Answer

Solution code:
S = input()

Count = [0 for _ in range(len(S))]
count = 0
reset = 1
for i, s in enumerate(S):
    if s in 'ACGT':
        if reset == 0:
            count += 1
            Count[i] = count
            reset = 0
        else:
            count += 1
            Count[i] = 1
            reset = 0
    else:
        reset = 1
print(max(Count))

Submission status: Wrong Answer

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

if temp == len(S):
    ans = temp
print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

for i in S:
    if i in ACGT:
        s += i
        l.append(s)
    else:
        l.append(s)
        s = ""

print(len(max(l)))

Submission status: Wrong Answer

Solution code:
S = list(input())
F = ["A", "C", "G", "T"]
count = 0
max = 0
f = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        f = max
        max = 0
print(max if max > f else f)

Submission status: Wrong Answer

Solution code:
S = list(input())
F = ["A", "C", "G", "T"]
count = 0
flag = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if flag < count:

        flag = count
    else:
        count = 0
print(flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

ans = 0
tmp = 0
for s in S:
  if s in ["A", "C", "G", "T"]:
    tmp += 1
  else:
    ans = max(ans, tmp)
    tmp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans = 0
for s in S:
  if s in ["A", "C", "G", "T"]:
    ans += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
def actual(s):
    is_ACGT_string = lambda x: set(x).issubset({'A', 'C', 'G', 'T'})

    N = len(s)

    if N == 1 and is_ACGT_string(s):
        return 1

    if N == 1 and not is_ACGT_string(s):
        return 0

    sub_strings = set()
    
    for i in range(N):
        for j in range(N - 1):
            sub_strings.add(s[i:j])

    length_list = []

    for sub_string in sub_strings:
        if is_ACGT_string(sub_string):
            length_list.append(len(sub_string))

    return max(length_list)

s = input()
print(actual(s))

Submission status: Wrong Answer

Solution code:
string = input()

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

count = 0
lengths = [0]
for s in string:
    if s in char:
        count += 1
    else:
        lengths.append(count)
        count = 0

print(max(lengths))

Submission status: Wrong Answer

Solution code:
string = input()

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

count = 0
lengths = [0]
for s in string:
    if s in char:
        count += 1
    else:
        lengths.append(count)
        count = 0
else:
    print(max(lengths))

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    s[i] = 1
  else:
    s[i] = 0
    
ans = []
for i in range(0,len(s)-2):
  for j in range(i,len(s)):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    s[i] = 1
  else:
    s[i] = 0
    
ans = []
for i in range(0,len(s)-2):
  for j in range(i,len(s)-1):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    s[i] = 1
  else:
    s[i] = 0
    
ans = []
for i in range(1,len(s)-2):
  for j in range(i,len(s)-1):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))

Submission status: Wrong Answer

Solution code:
def readinput():
    s=input()
    return s

def main(s):
    
    maxlen=0
    templen=0
    for i in range(len(s)):
        if(s[i]=='A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T'):
            templen+=1
        else:
            if maxlen<templen:
                maxlen=templen
                templen=0
        
    return maxlen

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans=0
res=0
for i in range(0, len(S)):
    if(S[i]=='A' or  S[i]=='C' or S[i]=='G' or S[i]=='T'):
        res+=1
    else:
        ans = max(res, ans)
        res = 0

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

ans=0
res=0
for i in range(0, len(S)):
    if(S[i]=='A' or  S[i]=='C' or S[i]=='G' or S[i]=='T'):
        res+=1
    else:
        ans = max(res, ans)

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())

count = 0
record = 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 > record:
            record = count
if count>record:
    record = count

print(record)

Submission status: Wrong Answer

Solution code:
S = list(input())

count = 0
record = 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 > record:
            record = count

print(record)

Submission status: Wrong Answer

Solution code:
S=input()
L=['A','C','G','T']
no=0
x=0
for i in S:
  if i in L:
    x+=1
  else:
    x=0
  ans=max(x,no)
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
L=['A','C','G','T']
no=0
x=0
for i in S:
  if i in L:
    x+=1
  else:
    x=0
  ans=(x,no)
print(ans)

Submission status: Wrong Answer

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

for s in S:
    if s in lst:
        cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = read()
count=0
cnt_max=0
for i in range(len(S)):
  if S[i] in ['A', 'C', 'G', 'T']:
    count +=1
  else:
    cnt_max = max(cnt_max,count)
    count=0
print(cnt_max)

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
maxlength = 0
for s in S:
    if s in ['A','C','G','T']:
        count += 1
    else:
        maxlength = max(count, maxlength)
        count = 0
print(maxlength)

Submission status: Wrong Answer

Solution code:
s=input()
mx=0
for i in range(len(s)):
  a=s[:-i]
  for j in range(len(s)-i):
    b=a[j:]
    if b.count('A')+b.count('C')+b.count('G')+b.count('T')==len(b):
      mx=max(mx,len(b))
print(mx)

Submission status: Wrong Answer

Solution code:
s = input()
maxl = 0
l = 0
for i in range(len(s)):
  if s[i] in 'ACGT':
    l += 1
  else:
    if maxl < l:
      maxl = l
    l = 0
print(maxl)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

from re import findall

res = findall('[ACGT]*', s)
print(res)

Submission status: Wrong Answer

Solution code:
s=input()
def che(s):
  for c in s:
    if c=='A' or c=='C' or c=='G' or c=='T':
      pass
    else:
      return 0
  return 1
mx=""
for i in range(0,len(s)+1):
  for j in range(0, len(s)+1):
    com=s[i:j]
    if len(com)==0:
      continue
    if len(mx)<len(com) and che(com):
      mx=com
print(mx)

Submission status: Wrong Answer

Solution code:
import re
s = input()
len_s = len(s)
max_ACGT = 0

for i in range(len_s):
    for j in range(i + 1, len_s):
        partial_s = s[i:j]
        if len(re.findall('A|C|G|T', partial_s)) == len(partial_s) and len(partial_s) > max_ACGT:
            max_ACGT = len(partial_s)

print(max_ACGT)

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

Solution code:
S=input()

ans=0

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

Submission status: Wrong Answer

Solution code:
char=['A','C','G','T']
s=list(input())
count=0
ans=0
for i in s:
    if i in char:
        count+=1
    else:
        if ans<count:
            ans=count
        count=0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
acgt = ["A","C","G","T"]
ans = 0
tmp = 0
for i in range(len(s)):
    if s[i] in acgt:
        tmp += 1  
    else:
        ans = max(ans, tmp)
        tmp = 0
print(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] == 'T' or s[i] == 'G' or s[i] == 'C':
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ln = input()
output = ''
a = ''
for i in ln:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G' :
        a += i
    else:
        if len(output) < len(a):
            output = a
        a = ''
        
print(len(output))

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    ansmax = 0
    anstmp = 0
    for i in S:
        if i == "A" or i == "T" or i == "G" or i == "C":
            anstmp = anstmp + 1 
        else: 
            ansmax = max(ansmax,anstmp)
            anstmp = 0
    print(ansmax)
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC122B
S = input()
count_max = 0
count = 0
for i in range(len(S)):
    if "A" in S[i] or "C" in S[i] or"G" in S[i] or"T" in S[i]:
        count += 1
    #最長のACGT文字列が、文字列の末尾にあるときに対応する
    if i == len(S) and count>count_max:
        count_max = count
    #まだ列が途中であって、文字が途切れた時、maxを更新する
    else:
        if count > count_max:
            count_max = count
print(count_max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    acgt = [1 if s in ["A", "C", "G", "T"] else 0 for s in S]
    ans = 0
    tmp = 0
    for a in acgt:
        if a == 0:
            ans = max(ans, tmp)
            tmp = 0
            continue
        tmp += a
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()

x = []

for i in range(2**(len(s)-1)):
  tmp = [0]*(len(s)-1)
  for j in range(len(s)-1):
    if i >> j & 1:
      tmp[j] = 1
  x.append(tmp)
    
ans = []
temp = []
#print(x)
ss = ["A","T","G","C"]
for i in range(len(x)):
  temp = []
  for j in range(len(x[i])):
    if(x[i][j] == 1 and s[j] in ss):
      temp.append(s[j])
  ans.append(len(temp))

print(max(ans))

Submission status: Wrong Answer

Solution code:
s = input()
acgt = ['A','C','G','T']
i = 0
max = 0
count = 0

while i < len(s):
    if s[i] in acgt:
        count+=1
    else:
        if count > max:
            max = count
        count = 0
    i+=1

print(max)

Submission status: Wrong Answer

Solution code:
s=input()
a=0
n=0
for c in s:
    if c in 'ACGT':
        n+=1
    else:
        a=max(a,n)
        n=0
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
ans = 0
for s in S:
    if s in ['A', 'C', 'G', 'T']:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    l = 0
    for j in range(i, len(s)):
        if s[j] in acgt:
            l += 1
        else:
            ans = max(ans, l)
            break
ans = max(ans, l)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    l = 0
    for j in range(i, len(s)):
        print(s[j])
        if s[j] in acgt:
            l += 1
        else:
            ans = max(ans, l)
            break
ans = max(ans, l)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    l = 0
    for j in range(i, len(s)):
        if s[j] in acgt:
            l += 1
        else:
            ans = max(ans, l)
            break

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    for j in range(i, len(s)):
        if acgt >= set(s[i:j]):
            ans = max(ans, j-i)

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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]):
			ans = max(len(S[i:j]), ans)
print(ans)

Submission status: Wrong Answer

Solution code:
import re
S = str(input())
acgt = re.compile(r"[A,C,G,T]*")
s = re.findall(acgt, S)
print(len(max(s)))

Submission status: Wrong Answer

Solution code:
S = list(input())
ans = 0
cnt = 0
for s in S:
    if s in ['A','C','G','T']:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

acgt_max = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[j] != 'A' and s[j] != 'C' and s[j] != 'G' and s[j] != 'T':
            acgt_max = max(acgt_max, j - i)
            break
print(acgt_max)

Submission status: Wrong Answer

Solution code:
S=list(input())
count,count_max=0,0
for s in S:
  if s != 'A' and s != 'C' and s != 'G' and s != 'T':
    count_max=max(count_max,count)
    count = 0
  else:
    count += 1
print(count_max)

Submission status: Wrong Answer

Solution code:
s = input()

acgt_len = 0
max_len = 0

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

for i in range(len(s)):
    if s[i] in ACGT:
        acgt_len += 1
    else:
        max_len = max(acgt_len, max_len)
        acgt_len = 0

print(max_len)

Submission status: Wrong Answer

Solution code:
S = input()
result = 0

streak = 0
for s in S:
    if s == 'A' or s == 'T' or s == 'G' or s == 'C':
        streak += 1
    else:
        result = max(streak, result)
        streak = 0
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
N = len(S)
ans = 0
for i,j in itertools.combinations(range(N),2):
    if all(x in 'ACGT' for x in S[i:j+1]):
        ans = max(ans,j+1-i)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    S = readline().strip()
    ACGT = {'A', 'C', 'G', 'T'}

    ans = 0
    for left in range(len(S) - 1):
        for right in range(1, len(S)):
            if all(c in ACGT for c in S[left:right]) and ans < right - left:
                ans = right - left

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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