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()
N = len(S)

ACGT = ['A', 'C', 'G', 'T']
count_list = []
count = 0
if S[0] in ACGT:
    count += 1
for i in range(1, N):
    if S[i] in ACGT:
        count += 1
    else:
        if count > 0:
            count_list.append(count)
            count = 0

if len(count_list) > 0:
    ans = max(count_list)
else:
    ans = 0
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
S+="b"
print(S)
ans=0
now=0
l=[i for i in "ACGT"]

for i in range(len(S)):
  if S[i] in l:
    now+=1
  else:
    ans=max(ans,now)
    now=0

print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
ans=0
now=0
l=[i for i in "ACGT"]

for i in range(len(S)):
  if S[i] in l:
    now+=1
  else:
    ans=max(ans,now)
    now=0

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
l=list("ACGT")
ans=0
for i in range(len(s)-1):
    for k in range(i+1,len(s)):
        if all(i in l for i in s[i:k]):
            ans=max(ans,len(s[i:k]))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
S = list(S)
str_list =  {"A","C","G","T"}
str_max = 0
print(S)
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)+1):
        S_list = S[start:end]

        if str_list | set(S_list) == str_list:
            str_max = max(str_max, len((S_list)))
           # print(str(S_list)+'はオッケーでした，記録は'+str(len(set(S_list))))
        #else:
           # print(str(S_list)+'はダメでした')

print(str_max)

Submission status: Wrong Answer

Solution code:
S = input()
S = list(S)
str_list =  {"A","C","G","T"}
str_max = 0
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        S_list = S[start:end]

        if str_list | set(S_list) == str_list:
            str_max = max(str_max, len((S_list)))
print(str_max)

Submission status: Wrong Answer

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

str_max = 0
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G","T"}|set(S[start:end+1]) == {"A","C","G", "T"}:
            str_max = max(str_max, len(S[start:end+1]))

print(str_max)

Submission status: Wrong Answer

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

str_max = 0
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G","T"}|set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)

Submission status: Wrong Answer

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

str_max = 0
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G", "T"} |set(S[start:end]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end)

print(str_max)

Submission status: Wrong Answer

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

str_max = 0
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G", "T"} |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)

Submission status: Wrong Answer

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

str_max = 0
print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G", "T"} |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)

Submission status: Wrong Answer

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

str_max = 0
for start in range(len(S)):
    for end in range(start, len(S)+1):
        if {"A","C","G", "T" } |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)

Submission status: Wrong Answer

Solution code:
S=str(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:
        ans=max(ans,temp)
        temp=0

print(ans)

Submission status: Wrong Answer

Solution code:
S=str(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:
        ans=max(ans,temp)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
ans = 0
for i in s:
    if i == "A":
        count += 1
    elif i == "C":
        count += 1
    elif i == "G":
        count += 1
    elif i == "T":
        count += 1
    else:
        if ans <= count:
            ans = count
        count = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
s = "ATCHATTTKGTCC"
count = 0
ans = 0
for i in s:
    if i == "A":
        count += 1
    elif i == "C":
        count += 1
    elif i == "G":
        count += 1
    elif i == "T":
        count += 1
    else:
        if ans <= count:
            ans = count
        count = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
ans = 0
for i in s:
    if i == "A":
        count+=1
    elif i == "C":
        count += 1
    elif i == "G":
        count += 1
    elif i == "T":
        count += 1
    else:
        if ans < count:
            ans = count
        count = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s=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+=s[i]
print(len(ans))

Submission status: Wrong Answer

Solution code:
S = input()
man = 0
cnt = 0
l = ['A', 'C', 'G', 'T']
for s in S:
    res = False
    for i in l:
        if s == i:
            cnt += 1
            res = True
    if res == False:
        if man < cnt:
            man = cnt
        cnt = 0
print(man)

Submission status: Wrong Answer

Solution code:
S = input()
man = 0
cnt = 0
l = ['A', 'C', 'G', 'T']
for s in S:
    res = False
    for i in l:
        if s == i:
            cnt += 1
            res = True
    if cnt > 0 and res == False:
        if man < cnt:
            man = cnt
        cnt = 0
print(man)

Submission status: Wrong Answer

Solution code:
S = input()
cnt = 0
l = ['A', 'C', 'G', 'T']
for s in S:
    res = False
    for i in l:
        if s == i:
            cnt += 1
            res = True
    if cnt > 0 and res == False:
        break
print(cnt)

Submission status: Wrong Answer

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

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque

#input = stdin.readline


j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"


#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation



'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''

#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        #sqrt(n)+1以上は考えて約数はないので却下
        if n % k == 0:
            return False
            #割り切れたらFalse
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  # [1, 0, 3]

'''

def factorial(x, mod=10**9+7):
    # x!
    # 階乗
    # ex) factorial(5) = 120
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''


########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

def main():
    w=1
    steps=0
    state=0
    j=0
    k=0
    le=0
    ans=0
    dic=['A','C','G','T']
    #n=int(input())
    #a,b=map(int, input().split(" "))
    s=input()
    a=[i for i in s]#int取るとstrでも行ける
    #nl=list(map(int, input().split(" ")))#数字の時
    #print(a)
    for i in range(len(s)):
        if a[i] in dic:
            le +=1
        else:
            ans=max(le,ans)
            le=0


    print(ans)
    #if state in known_states and not flag: # state => 2 steps => 5
        #こうやってある要素がリストの中にあるか探すのか
    #print(f'steps: {steps}, state: {state}')
    #こう書いてあるとデバックしやすい

    #dp= [[0]*3 for i in range(5)]#列　行
    #dp用の0の入ったやつ
    #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
    #print(dp)＃初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
    DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
    exdp=np.zeros((3,4)) # ３×４の２次元配列を生成。2次元ならこう
    #dtypeは指定しないとfloatになる
    #for i in range(n):#ちょっとした入力に便利
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        #これだとintとlistをつなぐことになって不適
    #    dp[i] += [a]
    #    dp[i] += [b]
        #これはうまくいく
        #やり方はいろいろあるということ
    #print(dp)


    "1行1つの整数を入力を取得し、整数と取得する"
    #nl=list(map(int, input().split(" ")))#数字の時
    #print(number_list)
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)


    #s=input()
    #a=[int(i) for i in s]#int取るとstrでも行ける
    #print(a)
    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]#内包表記に慣れろ
    #print(pin_l)

    ls = ["a", "b", "c", "d", "e"]


    #print(ls[2:5])
    #スライスでの取得

    #print(ls[:-3])
    #一番左端から右から3番目より左まで取得

    #print(ls[:4:2])
    #スライスで1個飛ばしで取得
    #ないときは左端スタート
    #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
    #print(ls[::2])
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

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:
#ABC122B
def main():
    import sys
    S = sys.stdin.readline().rstrip()
    #print(S)
    L = ['A', 'C', 'G', 'T']
    cnt, ans = 0, 0
    for s in S:
        if s in L:
            cnt+=1
        else:
            if ans < cnt:
                ans = cnt
            #print(ans)
            cnt=0
    print(ans)


if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    S = input() + 'Z'
    flag = False
    length = 0
    ans = 0
    for i, c in enumerate(S):
        if flag and c == 'A' or c == 'T' or c == 'C' or c == 'G':
            length += 1
        elif flag:
            ans = max(ans, length)
            length = 0
            flag = False
        elif c == 'A' or c == 'T' or c == 'C' or c == 'G':
            flag = True
            length = 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    S = input()
    start = 0
    flag = False
    length = 0
    ans = 0
    for i, c in enumerate(S):
        if flag and c == 'A' or c == 'T' or c == 'C' or c == 'G':
            length += 1
        elif flag:
            ans = max(ans, length)
            length = 0
            flag = False
        elif c == 'A' or c == 'T' or c == 'C' or c == 'G':
            flag = True
            length = 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

s = input()
for i in range(len(s)):
    if s[i] in ['A','C','G','T']:
        f = 1
    else:
        f = 0
    if f:
        neko = neko + 1
    else:
        if nya < neko:
            nya = neko
        neko = 0
print(nya)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code

def resolve():
    S=input()
    s="AGCT"
    cnt=0
    ans=0
    for i in range(len(S)):
        if S[i] in s:
            cnt+=1
        else:
            ans=max(ans,cnt)
            cnt=0
    print(ans)

#%%submit!    
resolve()

Submission status: Wrong Answer

Solution code:
s = input()
import itertools
def judge(k):
    if s[k] == "A" or s[k] == "C" or s[k] == "G" or s[k] == "T":
        return True
    return False

ans = 0
for comb in itertools.combinations(range(len(s)),2):
    i,j = comb
    true = 1
    for k in range(i,j+1):
        if not judge(k):
            true = 0
            break
    if true == 1:
        ans = max(ans,j-i+1)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
max_len=0
for i in range(len(s)):
    for j in range(i+1, len(s)):
        cut = s[i:j]
        flag = True
        for k in range(len(cut)):
            if cut[k] not in ["A", "C", "G", "T"]:
                flag = False
        if flag:
            max_len = max(max_len, len(cut))

print(max_len)

Submission status: Wrong Answer

Solution code:
S = input()
n= len(S)
m = -1
def isACGT(str):
    return all(list(map(lambda c: c in 'ATCG', str)))

for i in range(n):
    for j in range(i, n):
        if isACGT(S[i:j]):
            m = max(m, j-i)

print(m)

Submission status: Wrong Answer

Solution code:
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

s=s0()

ans=0
c=0
for x in s:
    if x in "ACGT":
        c+=1
    else:
        ans=max(ans,c)
        c=0
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
import math
import sys
from collections import Counter, defaultdict, deque
from copy import copy, deepcopy
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations
from queue import Queue

read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines 

inf = float("inf")


def main():
    S = input()
    length = len(S)
    ret = 0
    for i in range(length+1):
        for j in range(i):
            count = 0
            break_flag = False
            
            _S = S[j:length-(i-j)]
            for s in _S:
                if s in 'ATGC':
                    count += 1
                else:
                    break_flag = True
                    break
            if break_flag:
                continue
            else:
                ret = max(ret, count)
    print(ret)
        
      
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import bisect
import math
import sys
from collections import Counter, defaultdict, deque
from copy import copy, deepcopy
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations
from queue import Queue

read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines 

inf = float("inf")


def main():
    S = input()
    length = len(S)
    ret = 0
    for i in range(length):
        for j in range(i):
            count = 0
            break_flag = False
            
            _S = S[j:length-(i-j)]
            for s in _S:
                if s in 'ATGC':
                    count += 1
                else:
                    break_flag = True
                    break
            if break_flag:
                continue
            else:
                ret = max(ret, count)
    print(ret)
        
      
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    t = 'ATGC'
    ans = 0
    S = input()
    temp = 0
    for s in S:
        if s in t:
            temp += 1
        else:
            ans = max(ans, temp)

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
words = 'ACGT'
ans = 0
cnt = 0
for c in s:
    if c in words:
        cnt += 1
        continue
    ans = max(ans, cnt)
    cnt = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

tmp_ans = 0
ans = 0
for c in s:
    if c in valid_chars:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

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

score = 0
tmp = 0
for i in s:
  if(i in list):
    tmp += 1
  else:
    score = max(score,tmp)
    tmp = 0

print(score)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

cnt = 0
max_cnt = 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 max_cnt < cnt:
            max_cnt = cnt
        cnt = 0

print(max_cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
sum=0
for i in range(n-1):
  if s[i]=="A"or"T"or"C"or"G":
    for j in range(i+1,n):
      if s[j]!="A"and s[j]!="T" and s[j]!="C" and s[j]!="G":
        sum=max(sum,j-i)
        break
print(sum)

Submission status: Wrong Answer

Solution code:
s=list(input())
t=[]
for i in range(len(s)):
    if s[i]!="A" and s[i]!="C" and s[i]!="G"and s[i]!="T":
        t.append(i)
if len(t)==0:
  print(len(s))
else:
  t=[-1]+t
  u=[]
  for i in range(len(t)-1):
    u.append(t[i+1]-t[i])
  print(max(u)-1)

Submission status: Wrong Answer

Solution code:
s=list(input())
t=[]
for i in range(len(s)):
    if s[i]!="A" and s[i]!="C" and s[i]!="G"and s[i]!="T":
        t.append(i)
if len(t)==0:
  print(0)
else:
  t=[-1]+t
  u=[]
  for i in range(len(t)-1):
    u.append(t[i+1]-t[i])
  print(max(u)-1)

Submission status: Wrong Answer

Solution code:
S = list(input())

c = 0
ans = 0

for i in S:
    if i=='A' or i=='C' or i=='G' or i=='T':
        c += 1
    else:
        if ans < c:
            ans = c
        c = 0

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

parts = []
ans = ""
tmp = ""
for s in S:
  if s in l:
    tmp += s
  else:
    if len(tmp) > len(ans):
      ans = tmp
    tmp = ""

print(len(ans))

Submission status: Wrong Answer

Solution code:
string = input()
lis = ["A","C","G","T"]

result  = 0
flag = 0
for i in string:
    if i in lis:
        flag +=1
    else :
        if result <= flag :
            result = flag
        flag = 0
print(result)

Submission status: Wrong Answer

Solution code:
S = input()
T = "ACGT"
ans = 0
cnt = 0
for s in S:
    if s in T:
        cnt += 1
    else:
        if cnt > ans:
            ans = cnt
        cnt = 0
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0

if len(s)==1:
    if s.count("A")+s.count("G")+s.count("C")+s.count("T") == 1:
        print(1)
        exit()

 
for i in range(len(s)-1):
    for j in range(i+1, len(s)+1):
        x = s[i:j]
        print(x)
        if x.count("A")+x.count("G")+x.count("C")+x.count("T") == len(x) and len(x) > ans:
            ans = len(x)
 
print(ans)

Submission status: Wrong Answer

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

print(ans)