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 = list(input())

count = 0
max_count = 0
for i in range(len(S)-1):
    if  S[i] == 'A' or \
        S[i] == 'C' or \
        S[i] == 'G' or \
        S[i] == 'T':
        count += 1
    else:
        if count > max_count:
            max_count = count
            count = 0

print(max_count)

Submission status: Wrong Answer

Solution code:
S = list(input())

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

print(max_count)

Submission status: Wrong Answer

Solution code:
S = list(input())

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

print(max_count)

Submission status: Wrong Answer

Solution code:
S=list(str(input()))
lst=['A','T','G','C']
N=len(S)
s=0
ans=0
def dp(s,ans):
  if s==N-1:
    return ans
  tmp=0
  if S[s] in lst:
    while S[s] in lst and s<=N-2:
      s+=1
      tmp+=1
    ans=max(ans,tmp)
    if s==N-1 and S[-1] in lst:
      ans+=1
    else:
      pass
    return dp(s,ans)
  else:
    return dp(s+1,ans)
if N>=2: 
  print(dp(s,ans))
else:
  if S[0] in lst:
    print(1)
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
S=list(str(input()))
lst=['A','T','G','C']
N=len(S)
s=0
ans=0
def dp(s,ans):
  if s==N-1:
    return ans
  tmp=0
  if S[s] in lst:
    while S[s] in lst and s<=N-2:
      s+=1
      tmp+=1
    ans=max(ans,tmp)
    return dp(s,ans)
  else:
    return dp(s+1,ans)
if N>=2: 
  print(dp(s,ans))
else:
  if S[0] in lst:
    print(1)
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
S = list(input())
ok = ["A", "C", "G", "T"]

len_list = []
tmp = 0

for l in S:
    if l in ok:
        tmp += 1
    else:
        len_list.append(tmp)
        tmp = 0

print(max(len_list) if len(len_list)>0 else len(S))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
set = set()
for i in range(len(S)):
    tmp_S = ''
    for s in S[i:]:
        if s == 'A' or s == 'C' or s == 'G' or s == 'T':
            tmp_S += s
        else:
            set.add(tmp_S)
            break

ans = 0
for s in set:
    ans = max(ans, len(s))
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
tmp_S = ''
ans = 0
for s in S:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        tmp_S += s
    else:
        ans = max(ans, len(tmp_S))
        tmp_S = ''
print(ans)

Submission status: Wrong Answer

Solution code:
#ABC122B
S = input()
SC= S.replace('C','A')
SCG = SC.replace('G','A')
SCGT = SCG.replace('T','A')
ans = 0
wk = 0
for i in range(int(len(S))):
    if SCGT[i:i+1] == 'A':
        wk += 1
    else:
        if wk >= ans:
            ans = wk
        wk =0

if ans == 0 and wk != 0:
    ans = wk
print(ans)

Submission status: Wrong Answer

Solution code:
#ABC122B
S = input()
SC= S.replace('C','A')
SCG = SC.replace('G','A')
SCGT = SCG.replace('T','A')
ans = 0
wk = 0
for i in range(int(len(S))):
    if SCGT[i:i+1] == 'A':
        wk += 1
    else:
        if wk >= ans:
            ans = wk
        wk =0
        
print(ans)

Submission status: Wrong Answer

Solution code:
#ABC122B
S = input()
SC= S.replace('C','A')
SCG = SC.replace('G','A')
SCGT = SCG.replace('T','A')
ans = 0
wk = 0
print(SCGT)
for i in range(int(len(S))):
    if SCGT[i:i+1] == 'A':
        wk += 1
    else:
        if wk >= ans:
            ans = wk
        wk =0
        
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
s = [s[i] for i in range(len(s))]
f = "ACGT"
c, i, lis = 0, 0, []
while i < len(s) - 1:
    if s[i] not in f:
        i += 1
        continue
    else:
        c += 1
        for n in range(i+1, len(s)):
            if s[n] not in f:
                lis.append(c)
                c = 0
                i += 2
                break
            elif n == len(s) - 1:
                c += 1
                lis.append(c)
                i += c
                break
            else:
                i += 1
                c += 1
print(0) if lis == [] else print(max(lis))

Submission status: Wrong Answer

Solution code:
s = input()
s = [s[i] for i in range(len(s))]
f = "ACGT"
c, i, lis = 0, 0, []
while i < len(s) - 1:
    if s[i] not in f:
        i += 1
        continue
    else:
        c += 1
        for n in range(i+1, len(s)):
            if s[n] not in f:
                lis.append(c)
                c = 0
                i += 2
                break
            else: c += 1
print(0) if lis == [] else print(max(lis))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

count = max_count = 0
for char in s:
    if char in ['A', 'T', 'G', 'C']:
        count += 1
    else:
        max_count = max(count, max_count)
        count = 0

print(max_count)

Submission status: Wrong Answer

Solution code:
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    S = input().rstrip()
    N = len(S)
    idx = 0
    ans = 0
    tmp = 0
    while idx < N:
        if S[idx] in ['A','C','G','T']:
            tmp += 1
        else:
            ans = max(ans,tmp)
            tmp = 0
        idx += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()

counter = 0
max_count = 0

for str_i in range(len(s)):
  
  if s[str_i] in ['A', 'G', 'C', 'T']:
    counter += 1
  else:
    max_count = max(max_count, counter)
    counter = 0

print(max_count)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def main():
    S = input()[:-1]

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#122b
S = str(input()) #S は長さ 1 以上 10 以下の文字列である

ans = 0
temp_ans=0

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

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
Answer = 0
for i in range(len(S)):
    counter = 0
    for j in range(len(S)-i-1):
        if S[j] in ['A','T','G','C']:
            counter += 1
            if Answer < counter:
                Answer = counter
            j = i + 1
print(Answer)

Submission status: Wrong Answer

Solution code:
s=input()
s=s.replace("A","a")
s=s.replace("C","a")
s=s.replace("G","a")
s=s.replace("T","a")
c=0
for i in range(len(s)-1):
  if  s[i] =='a'and s[i+1]=='a':
    c+=1
if c==0:
  print(0)
else:
  c+=1
  print(c)

Submission status: Wrong Answer

Solution code:
s=input()
s=s.replace("A","a")
s=s.replace("C","a")
s=s.replace("G","a")
s=s.replace("T","a")
c=0
for i in range(len(s)-1):
  if  s[i] =='a'and s[i+1]=='a':
    c+=1
    if c==0:
      print(0)
    else:
      c+=1
      print(c)

Submission status: Wrong Answer

Solution code:
import re;print(len(max(re.findall(r"[ACGT]+",input()),"",key=len)))

Submission status: Wrong Answer

Solution code:
lst = ["A", "C", "G", "T"]
s = input()
res = 0
tmp = 0
if len(s) == 1:
    if s in lst:
        res = 1
else:
    for e in s:
        if e in lst:
            tmp += 1
        else:
            if tmp > res:
                res = tmp
            tmp = 0
print(res)

Submission status: Wrong Answer

Solution code:
S = input()

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

print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
mx=0
flag=1
for i in range(10):
    for j in range(10):
        if i>j:
            continue
        for s in S[i:j]:
            if s not in ['A','G','C','T']:
                flag=0
                break
        if flag:
            mx=max(len(S[i:j]),mx)
        else:
            flag=1

print(mx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

ans = 0
# for i in range(n):
i = 0
while i <= len(s) - 1:
    index = i
    length = 0
    while i <= len(s) - 1:
        if s[i] in ["A", "C", "G", "T"]:
            i += 1
            length += 1
        else:
            i += 1
            # ans = [index, length]
            ans = max(ans, length)
            break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
cnt = 0
maxi = 0
for s in S:
    if s in ("A","C","G","T"):
        cnt +=1
    else:
        maxi = max(maxi,cnt)
        cnt = 0
print(maxi)

Submission status: Wrong Answer

Solution code:
import re
S = input()
A = re.findall(r'[ATCG]+', S)
if A:
    A.sort(reverse=True)
    print(len(A[0]))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
s=list(input())
cnt,ans=0,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:
        ans=max(cnt,ans)
        cnt=0
print(ans)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
s = input()

string = 'ACGT'
ans = 0
tmp = 0

# 全部数え上げ。1文字ずつ確認し最大値を更新する
for i in s:
    if i in string:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
S = list(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 ans < count:
            ans = count
        else:
            pass
        count = 0
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
acgt=["A", "C", "G", "T"]
count=0
max_count=0
for s in S:
    #print(s)
    if s in acgt:
        count += 1
    else:
        if count > max_count:
            max_count = count
        count=0
print(max_count)

Submission status: Wrong Answer

Solution code:
s = input()

ans = 0
for i in range(len(s)):
    for j in range(len(s)):
        ss = s[i:j]
        acgt = ['A', 'C', 'G', 'T']
        fl = 1
        for si in ss:
            if si not in acgt:
                fl = 0
                break
        if fl == 1 and len(ss) > 0:
            ans = max(ans, j - i)

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        ss = s[i:j]
        acgt = ['A', 'C', 'G', 'T']
        fl = 1
        for si in ss:
            if si not in acgt:
                fl = 0
                break
        if fl == 1 and len(ss) > 0:
            ans = max(ans, j - i)

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

ans = 0
for i in range(10):
    for j in range(i,10):
        ss = s[i:j]
        acgt = ['A','C','G','T']
        fl = 1
        for si in ss:
            if si not in acgt:
                fl = 0
                break
        if fl == 1 and len(ss) > 0:
            ans = max(ans, j-i)


print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
res = 0
for i in range(len(S)):
    for j in range(len(S)):
        if all("ACGT".count(c) for c in S[i:j]):
            res = max(res, len(S[i:j]))
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
acgt = list("ACGT")

left, right = 0, 0
res = 0
for s in list(S):
    if s in acgt:
        right += 1
    else:
        res = max(res, right - left)
        left = right + 1
        right = left
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
acgt = list("ACGT")

res = 0
for i in range(len(S)):
    if S[i] not in acgt:
        continue

    count = 1
    for j in range(i+1, len(S)):
        if S[j] in acgt:
            count += 1
        else:
            res = max(res, count)
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S)
ACGT_list = ["A", "C", "G", "T"] 

max_ACGT = 0
count = 0
for i in range(len(S_list)):
    if S_list[i] in ACGT_list:
        count += 1
    else:
        if max_ACGT < count:
            max_ACGT = count
        else:
            pass
        count = 0
print(max_ACGT)

Submission status: Wrong Answer

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

for i in range(len(S)):
    count = 0
    for j in range(len(S)):
        if S[j] in acgt:
            count += 1
        else:
            if ans < count:
                ans = count


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

ans =[0]
cnt = 0

for i in s:
	if (i == "A" or i == "C" or i == "G" or i == "T"):
		cnt+= 1
	else:
		if cnt>0:
			ans.append(cnt)
			cnt=0
print(max(ans))

Submission status: Wrong Answer

Solution code:
word = input()

ATCG =['A', 'T', 'C', 'G']
count = 0
countlist = []

for x in word:
    if x in ATCG:
        count+=1
    elif count!=0:
        countlist.append(count)
        count = 0

if countlist !=[]:
    print (max(countlist))
else:
    print (count)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = list(input())

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

c = 0
c_max = 0
for i in range(len(s)):
    if s[i] in AGCT:
        c += 1
    else:
        c_max = max(c_max, c)
        c = 0

print(c_max)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = list(input())

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

c = 0
c_max = 0
for i in range(len(s)):
    if s[i] in AGCT:
        c += 1
    else:
        c_max = max(c_max, c)

print(c_max)

Submission status: Wrong Answer

Solution code:
S = input()

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

print(ans)

Submission status: Wrong Answer

Solution code:
import re
x = input()
print(len(re.findall('A',x))+len(re.findall('C',x))+len(re.findall('G',x))+len(re.findall('T',x)))

Submission status: Wrong Answer

Solution code:
n = input()

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

num = 0
ct = 0
for i in n:
    if i in l:
        ct += 1
    else:
        num = max(num,ct)
        ct = 0

print(num)

Submission status: Wrong Answer

Solution code:
def makelist(n, m):
    return [[0 for i in range(m)] for j in range(n)]

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

Submission status: Wrong Answer

Solution code:
n = input()
l = ['A', 'C', 'G', 'T']
num = 0
ct = 0
for i in n:
    if i in l:
        ct += 1
    else:
        num = max(num,ct)
        ct = 0
    
print(num)

Submission status: Wrong Answer

Solution code:
n = input()
l = ['A', 'C', 'G', 'T']
string = []
for i in n:
    if i in l:
        string.append(i)
    elif not string:
        pass
    else:
        break
    
print(len(string))

Submission status: Wrong Answer

Solution code:
import re
S = re.findall("[ACGT]*",input())
print(len(max(S)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

long_record = 0
for car in s:
  if car in ACGT:
    temp += 1
  else:
    if long_record < temp:
      long_record = temp
    temp = 0
print(long_record)

Submission status: Wrong Answer

Solution code:
S = input()

ans = 0
cnt = 0
for s in S:
    if s in "ACGT":
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 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, N):
    if all('ACGT'.count(c) == 1 for c in S[i:j+1]):
      ans += max(ans, j-i+1)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
count = 1
for i in range(1, len(s)):
    if s[i] in "ATGC" and s[i-1] in "ATGC":
        count += 1
    else:
        pass
if count == 1:
    count = 0
        
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
max_c = 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:
        if count > max_c:
            max_c = count
        count = 0
print(max_c)

Submission status: Wrong Answer

Solution code:
s = input().replace('A','#').replace('C','#').replace('G','#').replace('T','#')
ans,count = 0,0
for i in s:
    if i == '#':
        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 S:
  if i in ('A', 'C', 'G', 'T'):
    count += 1
  else:
    if count > ans:
      ans = count
    count = 0
if count != 0 and ans == 0:
  ans = count
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=list(str(input()))
s=0
for i in range(len(n)):
  if n[i]=="A"or n[i]=="T"or n[i]=="C"or n[i]=="G":
    s=s+1
print(s)

Submission status: Wrong Answer

Solution code:
n=list(str(input()))
s=0
for i in range(len(n)):
  if n[i]=="A"or"T"or"C"or"G":
    s=s+1
print(s)

Submission status: Wrong Answer

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

    target = ["A", "G", "C", "T"]
    mx = 0
    count = 0
    for ch in S:
        if ch in target:
            count += 1
        else:
            mx = max(mx, count)
            count = 0
    print(mx)


if __name__ == '__main__':
    func()

Submission status: Wrong Answer

Solution code:
S = input()

max_len = 0
memo_len = 0
flag = True

for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="G" or S[i]=="C":
        if flag == True:
            memo_len += 1
        else:
            max_len = memo_len
            memo_len = 1
            flag = True
    else:
        flag = False
        

print(max_len)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
max = 0
for i in range(len(S)):
	if S[i] in 'ACGT':
		ans += 1
	else:
		if max < ans:
			max = ans
		ans = 0
print(max)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
count = 0
for s in S:
    if s in 'ACGT':
        count += 1
    else:
        ans = max(ans, count)
        count = 0
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = list(input())
n = len(str)
counter = [0,0,0]
max = 0

for i in range(n):
  if 'A' in str[i] or 'T'in str[i] or 'C' in str[i]or 'G'in str[i]:
    
    counter.insert(i, counter[i] + 1)
  else:
    counter.append(0)
  

con = 0;    
for i in range(n):
  if counter[i] == 1:
    con += 1
    continue
  else :
    if con > max :
      max = con
      con = 0
    
print(max)

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
swich = 0
seal = 0
acgt = {'A','T','G','C'}
for s in S:
    if swich == 0:
        if s in acgt:
            swich = 1
            seal = 1
    else:
        if s in acgt:
            count += 1
        else:
            swich = 0
if seal == 0:
    print(0)
else:
    print(count+1)

Submission status: Wrong Answer

Solution code:
s = str(input())

result = [0]
i = 0
counter = 0
while i+counter < len(s):
    counter = 0
    h = 1
    while i + counter < len(s) and h == 1:
        if s[i+counter] == 'A' or s[i+counter] == 'T' or s[i+counter] == 'G' or s[i+counter] == 'C':
            counter += 1
        else:
            result.append(counter)
            i += counter +1
            h = 0
print(max(result))

Submission status: Wrong Answer

Solution code:
s = str(input())

result = [0]
i = 0
while i < len(s):
    counter = 0
    while i + counter < len(s):
        if s[i+counter] == 'A' or s[i+counter] == 'T' or s[i+counter] == 'G' or s[i+counter] == 'C':
            counter += 1
        else:
            result.append(counter)
            i += counter +1
print(result)

Submission status: Wrong Answer

Solution code:
s = input()

pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)

Submission status: Wrong Answer

Solution code:
s = input()

pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
            count = 0

print(mx)

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
atgc = ["A","T","G","C"]
cout = 0
a = [0]+[]
for i in range(len(S)):
    if S[i] in atgc:
        cout+=1
    if (S[i] not in atgc) and cout>0:
        a.append(cout)
        cout = 0
   
ans = max(a)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    else:
        if count > max_count:
            max_count = count
        count = 0
print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    else:
        if count > max_count:
            max_count = count
            count = 0
print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    else:
        if count > max_count:
            max_count = count
print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    else:
        if count > max_count:
            max_count += count
print(max_count)

Submission status: Wrong Answer

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

max_ = 0
cnt = 0
f = False
for n in range(len(S)):
    if (not f) and S[n] in L:
       cnt = 1
       f = True
    elif not f:
        pass
    elif f and S[n] in L:
        cnt += 1
    else:
        max_ = max(max_, cnt)
        cnt = 0
        f = False

print (max_)

Submission status: Wrong Answer

Solution code:
s = input()
acgt = "ACGT"
c = 0
c_max = 0

for i in s:
    if i in acgt:
        c += 1
    else:
        if c > c_max:
            c_max = c
        cnt = 0

print(c_max)

Submission status: Wrong Answer

Solution code:
S = list(input())
n = len(S)
m = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        print(S[i:j], j - i)
        if j - i > m and all(s in "ACGT" for s in S[i:j]):
            m = j - i
print(m)

Submission status: Wrong Answer

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

arr = []
st = ""

for s in S:
    if st and s not in L:
        arr.append(st)
        st = ""
    if s in L:
        st += s

print(max(map(len, arr)) if arr else 0)

Submission status: Wrong Answer

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

ans = 0
for s in S:
    if ans > 1 and s not in L:
        break
    if s in L:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
t=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':
        t+=1
    else:
        if t>=1:
            if ans<t:
                ans=t
        t=0
print(int(ans))

Submission status: Wrong Answer

Solution code:
s=list(input())
t=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':
        t+=1
    else:
        if t>=1:
            if ans<t:
                ans=t
            t=0
print(int(ans))

Submission status: Wrong Answer

Solution code:
s=list(input())
t=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':
        t+=1
    else:
        if t>=1 and ans<t:
            ans=t
            t=0
print(int(ans))

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

s=input().split()
s=list(s[0])
length=len(s)
ans=0
for i in range(length):
    cnt=0
    for j in range(i, length):
        if s[j]=="A"or s[j]=="C"or s[j]=="G"or s[j]=="T":
            cnt+=1
        else:
            ans=max(ans,cnt)
            break
ans=max(ans,cnt)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

s=input().split()
s=list(s[0])
length=len(s)
ans=0
for i in range(length):
    cnt=0
    for j in range(i, length):
        if s[j]=="A"or s[j]=="C"or s[j]=="G"or s[j]=="T":
            cnt+=1
        else:
            ans=max(ans,cnt)
            break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

from collections import deque

answer = 0
queue = deque()
target = {'A','C','G','T'}
for s in S:
    if s in target:
        queue.append(s)
    else:
        answer = max(answer, len(queue))
        queue.clear()

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
        if ans < cnt:
            ans = cnt

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

res = 0
tmp = 0

for char in S:
    if char in 'ACGT':
        tmp += 1
    else:
        res = max(res, tmp)

print(res)

Submission status: Wrong Answer

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
print(lenmax)

Submission status: Wrong Answer

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
print(l)