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()
ACGT = ["A", "C", "G", "T"]
count = 0
mx = 0
ans = 0
if S[0] in ACGT:
    count += 1
    mx = 1
    ans = 1
if len(S) >= 2:
    for i in range(len(S)-1):
        if S[i] in ACGT:
            if S[i+1] in ACGT:
                count += 1
            else:
                ans = max(count, mx)
                count = 0
                mx = ans
        else:
            if S[i+1] in ACGT:
                count = 1
            else:
                pass
                
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for i in range(n):
    for j in range(i,n):
        # ACGTに、sの一文字cが当てはまる場合1
        # それをsの文字ごとにループして調査する
        # すべてのsの文字が当てはまるなら、ansにsの長さを代入する
        if all('ACGT'.count(c) == 1 for c in s[i:j+1]):
            ans = max(ans, j-1+1)
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    s=input()
    tmp = 0
    cnt = 0
    for i in s:
        if i =='A' or i == 'T' or i =='C' or i=='G':
            cnt +=1
        else:
            if tmp <= cnt:
                tmp = cnt
                cnt = 0
            else:
                cnt = 0

    print(tmp)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s=input()
    tmp = 0
    cnt = 0
    for i in s:
        if i =='A' or i == 'T' or i =='C' or i=='G':
            cnt +=1
        else:
            if tmp <= cnt:
                tmp = cnt
                cnt = 0
                continue

    print(tmp)

if __name__ == '__main__':
    main()

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]):
            s = max(ans, j - i + 1)
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
up = 0
down = 0
count1 = 0
count2 = 0

for i in s:
  if i == "A" or i == "C" or i == "G" or i == "T" :
    count1 += 1
  else :
    break
    
for i in reversed(s):
  if i == "A" or i == "C" or i == "G" or i == "T" :
    count2 += 1
  else :
    break

if count1 > count2 :
  print(count1)
else :
  print(count2)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 15:19:36 2019

@author: avina
"""

s = 'ACGT'
S = input().strip()
g = 0
k = 0
if S[0] in s:
  k += 1
for i in range(1,len(S)):
  if S[i-1] in  s:
    if S[i] in s:
      k+=1
    else:
        k = 0
     
  elif S[i] in s:
      k = 1
     
  else:
    k=0
  g = max(k,g)
print(g)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 15:19:36 2019

@author: avina
"""

s = 'ACGT'
S = input().strip()
g = 0
k = 0
if S[0] in s:
  k += 1
for i in range(1,len(S)):
  if S[i-1] in  s:
    if S[i] in s:
      k+=1
     
  elif S[i] in s:
      k = 1
     
  else:
    k=0
  g = max(k,g)
print(g)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 15:19:36 2019

@author: avina
"""

s = 'ACGT'
S = input().strip()
g = 0
k = 0
if S[0] in s:
  k += 1
for i in range(1,len(S)):
  if S[i-1] in  s:
    if S[i] in s:
      k+=1
      g = max(g,k)
  elif S[i] in s:
      k = 1
      g = max(g,k)
  else:
    k=0
print(g)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 15:19:36 2019

@author: avina
"""

s = 'ACGT'
S = input().strip()
g = 0
k = 0
if S[0] in s:
  k += 1
for i in range(1,len(S)):
  if S[i-1] in  s:
    if S[i] in s:
      k+=1
      g = max(g,k)
  elif S[i] in s:
      k = 1
  else:
    k=0
print(g)

Submission status: Wrong Answer

Solution code:
S = input()

work = ""
maxlen = 0
for i in range(0, len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        if i > 0 and (S[i - 1] == "A" or S[i - 1] == "C" or S[i - 1] == "G" or S[i - 1] == "T"):
            work += S[i]
            maxlen += 1
        else:
            work = S[i]
            if maxlen < 1:
                maxlen = 1
    else:
        work = ""

print(maxlen)

Submission status: Wrong Answer

Solution code:
str = input()
dif = ("A","C","G","T")

isdif = False
maxdif = ""
tempdif = ""
for c in str:
    if c in dif:
        if isdif:
            tempdif += c
        else:
            tempdif = c
            isdif = True
    else:
        isdif = False
        if len(tempdif) > len(maxdif):
            maxdif = tempdif
        tempdif = ""
print(len(maxdif))

Submission status: Wrong Answer

Solution code:
str = input()
dif = ("A","C","G","T")

isdif = False
maxdif = ""
tempdif = ""
for c in str:
    if c in dif:
        isdif = True
        tempdif += c
    else:
        isdif = False
        if len(tempdif) > len(maxdif):
            maxdif = tempdif
        tempdif = ""
print(len(maxdif))

Submission status: Wrong Answer

Solution code:
import sys

b = input()

flg = 0
n = 0
nw = []
for bi in b:
    if bi == ("A" or "G" or "C" or "T"):
        flg = 1
        n += 1
    else:
        flg = 0
        n = 0
    nw.append(n)

nw.sort(reverse = True)
print(nw[0])

Submission status: Wrong Answer

Solution code:
s=input()
a=[1 if x=="A" or x=="C" or x=="G" or x=="T" else 0 for x in s]
b=[0]*len(s)
c=0
for i in range(len(a)-1):
    if a[i]==1 and a[i+1]==1:
        c+=1
        b[i]=c
print(max(b)+1 if 1 in a else 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
S =  Counter(list(input()))
ACGT = ["A", "C", "G", "T"]
count = 0
for s in ACGT:
  count += S[s]
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        for j in range(i+1, len(a)):
            if a[j] in ('A', 'C', 'G', 'T'):
                t += 1
                #print(a[j])
                if j == len(a)-1 and o < t:
                    o = t
            else:
                if o < t:
                    o = t
                break
# output
print(o)
# for i in range(a):
#    print(o[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        for j in range(i+1, len(a)):
            if a[j] in ('A', 'C', 'G', 'T'):
                t += 1
                # print(a[j])
                if j == len(a)-1 and o < t:
                    o = t
            else:
                if o < t:
                    o = t
# output
print(o)
# for i in range(a):
#    print(o[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        for j in range(i+1, len(a)):
            if a[j] in ('A', 'C', 'G', 'T'):
                t += 1
                print(a[j])
                if j == len(a)-1 and o < t:
                    o = t
            else:
                if o < t:
                    o = t
# output
print(o)
# for i in range(a):
#    print(o[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        k = i+1
        for j in range(len(a)-k):
            if a[j+k] in ('A', 'C', 'G', 'T'):
                t += 1
                # print(t)
                if j+k+1 == len(a) and o < t:
                    o = t
            else:
                if o < t:
                    o = t
# output
print(o)
# for i in range(a):
#    print(o[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# input
#a = int(input())
a = input()
#a, b, c = map(int, input().split())
#a, b, c = input().split()
o = 0
#o = []

# calc
for i in range(len(a)):
    t = 1
    if a[i] in ('A', 'C', 'G', 'T'):
        k = i+1
        for j in range(len(a)-k):
            if a[j+k] in ('A', 'C', 'G', 'T'):
                t += 1
               # print(t)
            else:
                if o < t:
                    o = t
# output
print(o)
# for i in range(a):
#    print(o[i])

Submission status: Wrong Answer

Solution code:
s=input()
cnt=0
for i in s:
    if 'ACGT'.find(i)>=0:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
str = input()
max_cnt = 0
cnt = 0
for s in str:
  if "ACGT".find(s) >= 0:
    cnt += 1
  else:
    if max_cnt < cnt:
      max_cnt = cnt
    cnt = 0

print(max_cnt)

Submission status: Wrong Answer

Solution code:
s = input()

cnt , mx = 0, 0
for i in s:
    if i == 'A' or i== 'T' or i == 'C' or i == 'G':
        cnt += 1
    else:
        mx = max(mx, cnt)

print(mx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

print(max_length)

Submission status: Wrong Answer

Solution code:
s = input()
a=0
b=0
for i in s:
    if i == "A" or i == "G" or i == "C" or i == "T":
        a+=1
    elif b<=a:
        b=a
        a=0
if a == len(s):
    print(a)
elif s[-1] == "A" or s[-1] == "G" or s[-1] == "C" or s[-1] == "T":
    print(a)
else:
    print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a=0
b=0
for i in s:
    if i == "A" or i == "G" or i == "C" or i == "T":
        a+=1
    elif b<=a:
        b=a
        a=0
print(b)

Submission status: Wrong Answer

Solution code:
s = input()
a=0
b=0
for i in s:
    if i == "A" or i == "G" or i == "C" or i == "T":
        a+=1
    elif b<a:
        b=a
        a=0
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re

S = input()

pattern = '[A|C|G|T]+'
match = re.search(pattern, S)
if match:
    print(match.end() - match.start())
else:
    print('0')

Submission status: Wrong Answer

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

ans = 0
for i in range(N):
    for j in range(1, 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()
N = len(S)

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

print(ans)

Submission status: Wrong Answer

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

ans = 0
counter = 0
for i in range(L):
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
        counter += 1
    else:
        if ans < counter:
            ans = counter

        counter = 0

print(ans)

Submission status: Wrong Answer

Solution code:
#coding-utf-8

def main():
    s = str(input())
    slist = list(s)
    stk = []
    c = []
    lenmax = 0
    for i in range(len(slist)):
        if slist[i] == 'A' or slist[i] =='C' or slist[i] =='G' or slist[i] =='T':
            stk.append(slist[i])
        else:
            c.append(stk)
            if len(stk) > 0:
                stk = []
                c.append(stk)
            stk = []

    for j in range(len(c)):
        if len(c[j]) > lenmax:
            lenmax = len(c[j])

    print(lenmax)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#coding-utf-8

def main():
    s = str(input())
    slist = list(s)
    stk = []
    c = []
    lenmax = 0
    for i in range(len(slist)):
        if slist[i] == 'A' or slist[i] =='C' or slist[i] =='G' or slist[i] =='T':
            stk.append(slist[i])
        else:
            c.append(stk)
            if len(stk) > 0:
                stk = []
                c.append(stk)
            stk = []

    print(c)

    for j in range(len(c)):
        if len(c[j]) > lenmax:
            lenmax = len(c[j])

    print(lenmax)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#coding-utf-8

def main():
    s = str(input())
    slist = list(s)
    stk = []
    c = []
    lenmax = 0
    for i in range(len(slist)):
        if slist[i] == 'A' or slist[i] =='C' or slist[i] =='G' or slist[i] =='T':
            stk.append(slist[i])
        else:
            c.append(stk)
            stk = []

    for j in range(len(c)):
        if len(c[j]) > lenmax:
            lenmax = len(c[j])

    print(lenmax)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#coding-utf-8

def main():
    s = str(input())
    slist = list(s)
    stk = []
    c = []
    lenmax = 0
    for i in range(len(slist)):
        if slist[i] == 'A' or slist[i] =='C' or slist[i] =='G' or slist[i] =='T':
            stk.append(slist[i])
        else:
            c.append(stk)
            stk = []

    for j in range(len(c)):
        if len(c[j]) >= lenmax:
            lenmax = len(c[j])

    print(lenmax)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import re

S = input()
pattern = "[ATGC]*"

matched_list = sorted(re.findall(pattern, S),
                      key=lambda s: len(s),
                      reverse=True)
print(matched_list)
print(len(matched_list[0]))

Submission status: Wrong Answer

Solution code:
import re

S = input()
pattern = "[ATGC]*"

matched_list = sorted(re.findall(pattern, S), reverse=True)
print(len(matched_list[0]))

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
maxcnt = 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:
        if cnt>maxcnt:
            maxcnt = cnt
            cnt = 0
        else:
            cnt = 0
print(maxcnt)

Submission status: Wrong Answer

Solution code:
import re

S = input()
pattern = "[ATGC]*"

matched_list = re.findall(pattern, S)
print(len(max(matched_list)))

Submission status: Wrong Answer

Solution code:
s = input()

count = 0
m = 0

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

Submission status: Wrong Answer

Solution code:
S = input()

counter = 0
pib = 0
for i in S:
    if i in 'AGCT':
        counter += 1
    else:
        if pib < counter:
            pib = counter
        counter = 0
print(pib)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
item=list(input())
result=0
sign=0
search=['A','C','G','T']
for i in range(len(item)):
    if item[i] in search:
        sign=sign+1
        continue
    if sign>result:
        result=sign
        sign=0
print(result)

Submission status: Wrong Answer

Solution code:
item=input()
result=0
sign=0
search="ACGT"
for i in range(len(item)):
    if item[i] in search:
        sign=sign+1
        continue
    if sign>result:
        result=sign
        sign=0
print(result)

Submission status: Wrong Answer

Solution code:
item=input()
result=0
sign=0
search="ACGT"
for i in range(len(item)):
    if item[i] in search:
        sign=sign+1
    elif sign>result:
        result=sign
        sign=0
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
listS = []
for i in range(len(S)):
  listS.append(S[i])
  

def check_ACGT(array):
  cnt = 0
  for i, elm in enumerate(array):
    if elm not in ["A", "C", "G", "T"]:
      cnt += 1
  return True if cnt == 0 else False

ans = 0
for i in range(len(listS)):
  for j in range(len(listS)):
    if i<j:
      sublistS = listS[i:j]
      if check_ACGT(sublistS) and ans < len(sublistS):
        ans = len(sublistS)

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
for i in range(len(S)):
  print(S[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()

b = 'ACGT'
ans =0
for i in a:
    print(i)
    now = 0
    for j in a:
        if j in b:
            now += 1
            print(now)
            ans = max(ans,now)
        else:
            now=0
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
l='ACTG'
ans=0
for i in range(0,n):
  for j in range(i,n):
    a=S[i:j]
    if set(l)>=set(a):
      ans=max(ans,len(a))
print(ans)

Submission status: Wrong Answer

Solution code:
b=str(input())
setb=['A','T','C','G']
lenmax=0
lenmaxlist=[]
for i in range(len(b)):
    if b[i] in setb:
        lenmax=lenmax+1;
    else:
        lenmaxlist.append(lenmax)
        lenmax=0
if lenmaxlist:
    print(max(lenmaxlist))
else:
    print(0)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
        cnt = 0

print(ans)

Submission status: Wrong Answer

Solution code:
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0

print(ans)

Submission status: Wrong Answer

Solution code:
j = 0
i = 0
count = 0
max_count = 0
b = input()

b = b.replace('A','*')
b = b.replace('T','*')
b = b.replace('G','*')
b = b.replace('C','*')

while i < len(b):
    if b[i] == "*":
        while i + j < len(b):
            if b[i+j] == "*":
                count += 1
                j += 1
            else:
                if count >= max_count:
                    max_count = count
                i = i + j
                j = 0
                break
    i += 1
    
print(max_count)

Submission status: Wrong Answer

Solution code:
raw_data = input()                                                               

max_len = 0 
buff_len = 0 

for i in range(len(raw_data)):

    for k,j in enumerate(raw_data[i:]):
    
        if j == "A":
            buff_len += 1 

        elif j == "T":
            buff_len += 1
    
        elif j == "G":
            buff_len += 1

        elif j == "C":
            buff_len += 1

        else:
            max_len = max(max_len,buff_len)
            buff_len = 0 
            break

        if k == len(raw_data[k:])-1:
            max_len = max(max_len,buff_len)
            buff_len = 0 
            break

print(max_len)

Submission status: Wrong Answer

Solution code:
raw_data = input()                                                               

max_len = 0 
buff_len = 0 

for i in range(len(raw_data)):

    for k,j in enumerate(raw_data[i:]):
        if j == "A":
            buff_len += 1 

        elif j == "T":
            buff_len += 1
    
        elif j == "G":
            buff_len += 1

        elif j == "C":
            buff_len += 1

        else:
            max_len = max(max_len,buff_len)

            buff_len = 0 
            break

        if k == len(raw_data) -1: 
            max_len = max(max_len,buff_len)
            buff_len = 0 
            break

print(max_len)

Submission status: Wrong Answer

Solution code:
raw_data = input()                                                               

max_len = 0 
buff_len = 0 

for i in range(len(raw_data)):

    for j in raw_data[i:]:
        if j == "A":
            buff_len += 1

        elif j == "T":
            buff_len += 1
    
        elif j == "G":
            buff_len += 1

        elif j == "C":
            buff_len += 1

        else:
            if max_len < buff_len:
                max_len = buff_len

            buff_len = 0 
            break


print(max_len)

Submission status: Wrong Answer

Solution code:
s=input()
len=0
ans=0
for c in s:
    if c in "AGCT":
        len+=1
    else:
        ans=max(ans,len)
        len=0
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
n = 0
atgc = [0] * len(S)

for i in S:
    i += i
    if ('A' in i) or ('C' in i) or ('G' in i) or ('T' in i):
        atgc[n] += 1
    else:
        n += 1
        
ans = min(atgc)
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
n = 0
atgc = [0] * len(S)

for i in S:
    if i == ('A' or 'C' or 'G' or 'T'):
        atgc[n] += 1
    else:
        n += 1
        
ans = min(atgc)
print(ans)

Submission status: Wrong Answer

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

def solve():
    S = input()

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


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
s = list(input())
acgt = ("A","C","G","t")
sb = [1 if moji in acgt else 0 for moji in s]
ans = 0
kei = 0
if 1 in sb :
  for n in sb :
    if n == 1 :
      ans+=1
    elif ans > kei :
      kei = ans
      ans = 0
print (kei)

Submission status: Wrong Answer

Solution code:
s=input()
s_2=[1 if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T" else 0 for i in range(len(s))]
s_3=0
for j in range(len(s)):
    s_3+=s_2[j]*(10**j)
s_3=str(s_3)
ans=0
for k in range(len(s)):
    if "1"*k in s_3:
        ans=k
print(ans)

Submission status: Wrong Answer

Solution code:
import re
regex=(r'[A|C|G|T]+')
s=input()
mo=re.findall(regex,s)
print(len(max(mo)) if mo!=[] else 0)

Submission status: Wrong Answer

Solution code:
import re
regex=(r'[A|C|G|T]+')
s=input()
mo=re.search(regex,s)
print(len(mo.group()) if mo!=None else 0)

Submission status: Wrong Answer

Solution code:
S = str(input())
A = 'ACGT'
L = len(S)

cnt = 0
max_cnt = 0
for x in S:
    if x in A:
        cnt += 1
    else:
        if max_cnt < cnt:
            max_cnt = cnt
        cnt = 0

print(max_cnt)

Submission status: Wrong Answer

Solution code:
S = str(input())
A = 'ACGT'
L = len(S)

cnt = 0
max_cnt = 0
for x in S:
    print(x, cnt)
    if x in A:
        cnt += 1
    else:
        if max_cnt < cnt:
            max_cnt = cnt
        cnt = 0

print(max_cnt)

Submission status: Wrong Answer

Solution code:
c = list(input())
ans = 0
for i in range(len(c)):
    j = i
    count = 0
    # print(i)
    # print(j)
    while ((c[j] == "A") or (c[j] == "C") or (c[j] == "G") or (c[j] == "T")) and j <len(c)-1:
         # print(c[j])
         count += 1
         j += 1
    ans = max(ans,count)
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
acgt_tmp = 0
acgt_max = 0

for s in S:
  if s in ['A','C','G','T']:
    acgt_tmp += 1
  else:
    if acgt_tmp>acgt_max:
      acgt_max = acgt_tmp
    acgt_tmp = 0

print(acgt_max)

Submission status: Wrong Answer

Solution code:
A = 'ATGC'
 
S = input()
leng = 0
k = 0
 
for s in S:
  if s in A:
    k += 1
  else:
    if k > leng:
      leng = k
      k = 0
      
print(leng)

Submission status: Wrong Answer

Solution code:
A = 'ATGC'

S = input()
leng = 0

for s in S:
  k = 0
  if s in A:
    k += 1
  else:
    if k > leng:
      leng = k
      
print(leng)

Submission status: Wrong Answer

Solution code:
S = input()
head = True
tial = False
ATCG = ['A', 'T', 'C', 'G']
c = 0
for s in S:
    if s in ATCG:
        c += 1
        if head:
            head = False
    else:
        if head:
            continue
        else:
            break
print(c)

Submission status: Wrong Answer

Solution code:
s = list(input())
len = 0
max_len = 0
for str in s:
    if str in ["A", "C", "G", "T"]:
        len += 1
    else:
        if len > max_len:
            max_len = len
        len = 0
print(max_len)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - ATCoder
s = input()
agct = ["A", "G", "C", "T"]
r = re = 0
for i in s:
	if i in agct:
		r += 1
	else:
		re = max(re, r)
		r =0
print(re)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

count = 0

for i in range(len(s)-1):
    if s[i] in dic:
        if s[i+1] in dic:
            count += 1
        else:
            count += 1
    else:
        pass
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
b = input()

tmp = 0
total = 0
for i in b :
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        tmp += 1
    else:
        total = max(total,tmp)
        tmp = 0

print(total)

Submission status: Wrong Answer

Solution code:
s= input()

chars = list(s)

s1 = ''
s2 = ''

for c in chars:

  if c in 'ACGT':
    s2 += c
  else:
    if len(s2) >= len(s1):
      s1 = s2
      s2 = ''

if s1 == '':
  print(len(s2))
else:
  print(len(s1))

Submission status: Wrong Answer

Solution code:
s= input()

chars = list(s)

s1 = ''
s2 = ''

for c in chars:

  if c in 'ACGT':
    s2 += c
  else:
    if len(s2) >= len(s1):
      s1 = s2
      s2 = ''

print(len(s1))

Submission status: Wrong Answer

Solution code:
src = input()
length = len(src)
acgt = set("ACGT")
ans = 0
for i in range(length):
    n = length - i
    for ngram in [src[k:k+n] for k in range(length - n + 1)]:
        print(ngram)
        subtract = len(set(ngram) - acgt)
        if subtract == 0:
            ans = n
            break
    if ans != 0:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
c_max=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 c_max < count:
      c_max=count
    count=0

if c_max < count:
  c_mac=count
print(c_max)

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):
        T = S[i:j]
        flag = True
        for t in set(T):
            if t not in ['A', 'C', 'G', 'T']:
                flag = False
                break
        if flag:
            ans = max(ans, len(T))
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):
        T = S[i:j]
        if len(set(T) | set(['A', 'C', 'G', 'T'])) <= 4:
            ans = max(ans, len(T))
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
a = 0
t = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        t += 1
    else:
        if t > a:
            a = t
            t = 0
a = t
print(a)

Submission status: Wrong Answer

Solution code:
s = input()
a = 0
t = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        t += 1
    else:
        if t > a:
            a = t
            t = 0
print(a)

Submission status: Wrong Answer

Solution code:
s = input()
a = 0
t = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        t += 1
    else:
        if t > a:
            a = t
print(a)

Submission status: Wrong Answer

Solution code:
b=input()
if b=="A":
    print("T")
if(b=='T'):
    print('A')
if(b=='G'):
    print('C')
if(b=='C'):
    print('G')

Submission status: Wrong Answer

Solution code:
C = input()
ans = 0
match = 0

for i in C:
    if (('A' in i) or ('C' in i) or \
        ('G' in i) or ('T' in i)) == 'True':
            ans += 1
    else:
        if ans >= match:
            match = ans
        ans = 0
print(match)