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: Runtime Error

Solution code:
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
        array.append(0)
    elif flag == True and S[i] == 'C':
        count += 1
        array.pop(-1)
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    if ff != True:
        print(0)
    if len(array[arr[0]-1:arr[1]-1]) < 2:
        print(0)
        continue
    for a in array[arr[0]-1:]:
        if a == -1:
            flag = True
        elif flag == True:
            minv = a
            break
    for b in reversed(array[:arr[1]]):
        if b != 0 and b != -1:
            maxv = b
            break
    if minv == maxv:
        print(1)
    else:
        print(maxv - minv + 1)

Submission status: Runtime Error

Solution code:
S = input()
M1 == S.rfind('A') - S.find('C') + 1
M2 == S.rfind('A') - S.find('G') + 1
M3 == S.rfind('A') - S.find('T') + 1
M4 == S.rfind('A') - S.find('A') + 1
M5 == S.rfind('C') - S.find('C') + 1
M6 == S.rfind('C') - S.find('A') + 1
M7 == S.rfind('C') - S.find('G') + 1
M8 == S.rfind('C') - S.find('T') + 1
M9 == S.rfind('G') - S.find('G') + 1
M10 == S.rfind('G') - S.find('C') + 1
M11 == S.rfind('G') - S.find('A') + 1
M12 == S.rfind('G') - S.find('T') + 1
M13 == S.rfind('T') - S.find('C') + 1
M14 == S.rfind('T') - S.find('A') + 1
M15 == S.rfind('T') - S.find('G') + 1
M16 == S.rfind('T') - S.find('T') + 1
print(max(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15, M16))

Submission status: Runtime Error

Solution code:
# coding: utf-8

string = list(input())
print(string)
num = 0
numlist = []
for i in range(len(string)):
    if string[i] == "A" or string[i] == "T" or string[i] == "G" or string[i] == "C":
            num += 1
    else:
        numlist.append(num)
        num = 0
print(max(numlist))

Submission status: Runtime Error

Solution code:
S = list(input())
count = [0]*10
i = 0
j = 0
while S[i] != None:
  while S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T": 
    count[j] += 1
    i += 1
  i += 1
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
s = input()
S = list(s)
count = [10]
i = 0
j = 0
while S[i] != None:
  while S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T": 
    count[j] += 1
    i += 1
  i += 1
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
mozi = input()
mozi_list = list(mozi)

a = len(mozi_list)
count = 0
b = 0
c = list()

for k in range(b, a):
    for i in range(b, a):
        if mozi_list[i] == "A" or mozi_list[i] == "A" or mozi_list[i] == "T" or mozi_list[i] == "G" or mozi_list[i] == "C":
            count += 1
        else:
            c.append(count)
    b += 1
    count = 0

x = max(c)
print(x)

Submission status: Runtime Error

Solution code:
s = input()
S = s.split()
count = [10]
i = 0
j = 0
while S[i] != None:
  while S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T": 
    count[j] += 1
    i += 1
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
s=list(input())
n=len(s)
ACGT=['A','C','G','T']
t=[]
count=0
for i in s:
    if i in ACGT:
        count+=1
    else:
        t.append(count)
print(max(t))

Submission status: Runtime Error

Solution code:
S = input()

ns = []
n = 0
for s in S:
    if s in 'ACGT':
        n += 1
    else:
        ns.append(n)
        n = 0

print(max(ns))

Submission status: Runtime Error

Solution code:
s = input().strip()
enki = set('ATCG')
count = 0
maxlen = 0
for i in range(len(s)):
    if s[i] in enki:
        count += 1
    else:
        maxlen = max(maxlen, count)
        count = 0

return maxlen

Submission status: Runtime Error

Solution code:
S = input()

ns = []
for s in S:
    if s in 'ACGT':
        n += 1
    else:
        ns.append(n)
        n = 0
print(max(ns))

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
i = 0
j = 0
while s[i] != None:
  while s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
  j += 1
print(max(count))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

AGCT = {"A", "G", "C", "T"}

j = 0
l = 0
l_log = []

while j < len(S):
    if S[j] in AGCT:
        j += 1
        l += 1
    else:
        l_log.append(l)
        l = 0
        j += 1

print(max(l_log))

Submission status: Runtime Error

Solution code:
S = input('')
M = (S.rfind{'A', 'C', 'G', 'T'}-S.find{'A', 'C', 'G', 'T'} + 1)
M_length = len(M)
print(max(M_length))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox): 
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Submission status: Runtime Error

Solution code:
len(max(re.sub(r'[^ACGT]', ' ', input()).split()))

Submission status: Runtime Error

Solution code:
S = str(input())
box = ["A", "G", "C", "T"]
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox): 
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Submission status: Runtime Error

Solution code:
S = input()
H = re.findall("[ACGT]+", S)
max_length = 0
for h in H:
	if max_length < len(h):
		max_length = len(h)
print(max_length)

Submission status: Runtime Error

Solution code:
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i+1):
    DUP=S[j:i]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count)
print(longest)
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i+1):
    DUP=S[j:i+1]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count)
print(longest)

Submission status: Runtime Error

Solution code:
S = input()
box = ["A", "G", "C", "T"]
 
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
result = []
for i in s:
    if i not in 'ACGT' and i == s[0]:
        pass
    if i in 'ACGT':
        ans += 1
        continue
    if i not in 'ACGT':
        result.append(ans)
        ans = 0
print(max(result))

Submission status: Runtime Error

Solution code:

from sys import stdin

str = stdin.readline().rstrip()


cnt = 0
rslt = 0




for a in str:
    flg = 0
    for b in "ATGC":
        if a == b:
            cnt = cnt + 1
            flg = 1
            break
            
    print(a + " :" + str(cnt))
    
    if rslt <= cnt:
        rslt = cnt
        
    if flg == 0:
        cnt = 0


print(rslt)

Submission status: Runtime Error

Solution code:
S = input()

b = 0

ans = []

s = list(S)

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

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
i = 0
j = 0
while True:
  if s[i] == None:
      break 
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
    continue
  j += 1
print(max(count))

Submission status: Runtime Error

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

ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

Submission status: Runtime Error

Solution code:
S = input()

b = 0

ans = []

for i in s:
  if (i == 'A' or i == 'G' or i == 'C' or i == 'T'):
    b += 1
  else:
    ans.append(b)
    b = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

print(s,s2)

tmp = 0
ret = 0
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
        tmp = 0
ret = max(ret, tmp)
print(ret)

Submission status: Runtime Error

Solution code:
S = input('')
M = (S.rfind{'A', 'C', 'G', 'T'}-S.find{'A', 'C', 'G', 'T'} + 1)
print(max(M))

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
i = 0
j = 0
while True:
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
    if s[i] == None:
      break 
    continue
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
S = str(input())

Y = list(S)
Z = [0] * (len(Y) + 1)
U = []

for i in range(len(Y)):
    if Y[i] == "A" or Y[i] == "T" or Y[i] ==  "C" or Y[i] == "G":
        Z[i + 1] = 1
    else:
        Z[i + 1] = 0

W = [j for j, x in enumerate(Z) if x == 0]

for k in range(len(W) - 1):
    U.append(W[k + 1] - W[k] - 1)

print(max(U))

Submission status: Runtime Error

Solution code:
s=list(input())
counts=0
lists=[]
a=len(s)
for i in range (1,a+1):
    if s[i-1]=='A':
        counts=counts+1
        lists.append(counts)
    elif s[i-1]=='G':
        counts=counts+1
        lists.append(counts)
    elif s[i-1]=='T':
        counts=counts+1
        lists.append(counts)
    elif s[i-1]=='C':
        counts=counts+1
        lists.append(counts)
    else:
        counts=0
lists.sort()
k=len(lists)
print(lists[k-1])

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
i = 0
j = 0
while True:
  while s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
    if s[i] == None:
      break 
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
S = input('')
T = (S.rfind{'A', 'C', 'G', 'T'}-S.find{'A', 'C', 'G', 'T'} + 1)
print(T.max)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 20:27:19 2019

@author: screamLab
"""

s = input()
atcg = ['A','T','C','G']
ans = 0
long = 0
for i in range(len(s)):
    if s[i] in atcg:
        if s[i+1] in atcg:
            ans += 1
        else:
            ans += 1
    long = max(long,ans)
    ans = 0
long = max(long,ans)
print(long)

Submission status: Runtime Error

Solution code:
S = str(input())

Y = list(S)
Z = [0] * len(Y)
U = []

for i in range(len(Y)):
    if Y[i] == "A" or Y[i] == "T" or Y[i] ==  "C" or Y[i] == "G":
        Z[i] = 1
    else:
        Z[i] = 0

W = [j for j, x in enumerate(Z) if x == 0]

for k in range(len(W) - 1):
    U.append(W[k + 1] - W[k] - 1)

print(max(U))

Submission status: Runtime Error

Solution code:
S = input()

ACGT = []
tmp = ""
for s in S:
    if s == "A" or s == "C" or s == "G" or s == "T":
        tmp += s
    else:
        ACGT.append(tmp)
        tmp = ""

print(len(sorted(ACGT, key=lambda x: len(x))[len(ACGT)-1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
print(max(map(len, s_list)))

Submission status: Runtime Error

Solution code:
S = input()

subStringList = []
length = len(S)

for i in range(length) :
    for j in range(1,length+1):
        if (i+j <= length) :
            subStringList.append(S[i:i+j])
        else:
            break


for s in subStringList[:]:
    for letter in s:
        if (not(letter in "ATGC")):
            subStringList.remove(s)
            break

print(len(max(subStringList, key=len)))

Submission status: Runtime Error

Solution code:
for i in range(len(S)):
    for j in range(i, len(S)):
        count = 0
        print(list(S[i:j+1]))
        for s in list(S[i:j+1]):
            if s in ['A', 'G', 'T', 'C']:
                count += 1
            else:
                if m <= count:
                    m = count
                count = 0
print(m)

Submission status: Runtime Error

Solution code:
inp = input()
ans = 0
li = []
for i in inp:
    if i == "A" or i == "T" or i == "C" or i == "G":
        ans += 1
    else:
        li.append(ans)
        ans = 0
print(max(li))

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
i = 0
j = 0
while True:
  while s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
    if i > 9:
      break
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
S = input()

subStringList = []
length = len(S)

for i in range(length) :
    for j in range(1,length+1):
        if (i+j <= length) :
            subStringList.append(S[i:i+j])
        else:
            break


for s in subStringList[:]:
    for letter in s:
        if (not(letter in "ATGC")):
            subStringList.remove(s)
            break

print(len(max(subStringList)))

Submission status: Runtime Error

Solution code:
S = list(input())
   
ans = []
pre = 0
for s in S:
    if s == 'A' or s == 'C' or s == 'G'or s == 'T':
        pre += 1
    else:
        ans.append(pre)
        pre = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
j = 0
while True:
  while s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": 
    count[j] += 1
    i += 1
    if i > 9:
      break
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

Submission status: Runtime Error

Solution code:
ACGT = ['A', 'C', 'G', 'T']


def not_acgt(s):
    for c in s:
        if c not in ACGT:
            return False

    return True


def main():
    S = input()

    results = []
    # all_results = []
    for i in range(len(S)):
        for j in range(len(S)):
            if not_acgt(S[i:j+1]):
                results.append(S[i:j+1])
            # all_results.append(S[i:j+1])

    print(max([len(s) for s in results]))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
S = str(input())
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

Submission status: Runtime Error

Solution code:
b = input()
let = 'ATGC'
prev = b[0]
high = 0
if prev in let:
    leng = 1
    high = 1
for i in range(1,len(b)):
    if leng == 0 and b[i] in let:
        leng = 1
    if b[i] in let and prev in let:
        print(b[i])
        leng += 1
    else:
        if leng > high:
            high = leng
    prev = b[i]

print(high)

Submission status: Runtime Error

Solution code:
import re
ptn = re.compile(r"(A|C|T|G)*")

S = input()
T = set()
for i in range(len(S)):
  for j in range(len(S)):
    x = ptn.match(S[i:i+j+1])
    if(x.group(0)):
      T.add(len(x.group(0)))
print(max(T))

Submission status: Runtime Error

Solution code:
s = input()
count = [10]
j = 0
while True:
  while s[i] == "A" or "C" or "G" or "T":
    count[j] += 1
    i += 1
  if i >= 9:
    break
  j += 1
print(max(count))

Submission status: Runtime Error

Solution code:
b = input()
l = len(b)
ans = []
kotae = 1
c = []
for i in range(l):
  if b[i]=="A" or b[i]=="T" or b[i]=="G" or b[i]=="C":
    ans.append(i)
l2 = len(ans)
for i in range(l2-1):
  if (ans[i+1]-ans[i])==1 and i==l2-2:
    kotae+=1
    c.append(kotae)
  elif (ans[i+1]-ans[i])==1:
    kotae+=1
  else:
    c.append(kotae)
    kotae=1
if ans==[]:
  print(0)
else:print(max(c))

Submission status: Runtime Error

Solution code:
def f(x):
    length=0
    array=[]
    for b in x:
        if b==True:
            length+=1
        else:
            array.append(length)
            length=0

    return array

s=input()
sb = ['A','C','G','T']
boola=list()
length=0

for x in s:
    boola.append(x in sb)

print(max(f(boola)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
moji=str(input()) #文字列の入力
ListNum=[] #suuの各値を入れる
suu=0
for i in range(0,len(moji),1):
  if moji[i]=="A":
    suu+=1
  elif moji[i]=="T":
    suu+=1
  elif moji[i]=="G":
    suu+=1
  elif moji[i]=="C":
    suu+=1
  else:
    ListNum.append(suu)
    suu=0
print(max(ListNum))

Submission status: Runtime Error

Solution code:
s = input()
count = []
j = 0
while True:
  while s[i] == "A" or "C" or "G" or "T":
    count[j] += 1
    i += 1
  if i >= 9:
    break
  j += 1
print(max(count))

Submission status: Runtime Error

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

i = input()

c = 0
c_list = []

if len(i) == 1:
    if i in ['A', 'C', 'G', 'T']:
        print(1)
        exit()
    else:
        print(0)
        exit()

for moji in i:
    if moji in ['A', 'C', 'G', 'T']:
        c += 1
    else:
        c_list.append(c)
        c = 0

print(max(c_list))

Submission status: Runtime Error

Solution code:
b = input()
let = 'ATGC'
prev = b[0]
if prev in let:
    leng = 1
lens = []
for i in range(1,len(b)):
    if leng == 0 and b[i] in let:
        leng = 1
    if b[i] in let and prev in let:
        print(b[i])
        leng += 1
    else:
        lens.append(leng)
        leng = 0
    prev = b[i]

print(max(lens))

Submission status: Runtime Error

Solution code:
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        for j in range(i, len(S)-i):
            if S[j] in list_atgc:
                demand_list.append(S[i:j+1])
print(len(max(demand_list, key=len)))

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ["A","C","G","T"]
index = []
for i in range(len(S)):
    if S[i] not in ACGT:
        index.append(i)

diff = [index[0]]
for j in range(len(index)-1):
    diff.append(index[j+1] - index[j] - 1)

print(max(diff))

Submission status: Runtime Error

Solution code:
moji=str(input()) #文字列の入力
ListNum=[] #suuの各値を入れる
suu=0
for i in range(0,len(moji),1):
  if moji[i]=="A":
    suu+=1
  elif moji[i]=="T":
    suu+=1
  elif moji[i]=="G":
    suu+=1
  elif moji[i]=="C":
    suu+=1
  else:
    ListNum.append(suu)
    suu=0
print(max(ListNum))

Submission status: Runtime Error

Solution code:
S = input()
import re
regex = re.compile(r"[ATGC]+")
mo = regex.findall(S)
l=[]
for item in mo:
    l.append(len(item))
print(max(l))

Submission status: Runtime Error

Solution code:
s=input()
n = len(s)
check = []
check.append(s)
while True:
    if checkACGT(check[0]):
        print(len(check[0]))
        break
    else:
        if len(check[0]) == 1:
            print(0)
            break
        check.append(check[0][1:])
        check.append(check[0][:len(check[0])-2])
        check.pop(0)

Submission status: Runtime Error

Solution code:
import math
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
        else:
            temp*=2
            L.append(temp)
    else:
        temp = 0
print(int(math.log2(max(L))+1))

Submission status: Runtime Error

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

# input
# ATCODER

i = input()

c = 0
c_list = []
for moji in i:
    if moji in ['A', 'C', 'G', 'T']:
        c += 1
    else:
        c_list.append(c)
        c = 0


print(max(c_list))

Submission status: Runtime Error

Solution code:
S = input()
S_list = list(S)
answers = []
acgt = 0
for s in S_list:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        acgt += 1
    else:
        answers.append(acgt)
        acgt = 0
print(max(answers))

Submission status: Runtime Error

Solution code:
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        for j in range(i, len(S)-i):
            if S[j] in list_atgc:
                demand_list.append(S[i:j+1])
print(max(demand_list, key=len))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

s=list(input())



for i in range(len(s)):
    if s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C":
        s[i]=1
    else:
        s[i]=0
list=[]
for i in range(len(s)):
    for j in range(len(s)-i):
        if s[i+j]==0:
            list.append(j)
            break

print(max(list))

Submission status: Runtime Error

Solution code:
S = input()                 
count = 0
j=0
num=[]
for i in range(len(S)):
    # for j in range(4):
    #     if S[i]==ATCG[j]:
    if S[i] == 'A' or S[i]=='T' or S[i]=='C' or S[i]== 'G':
        count=count+1
        #print(S[i])
    else:
        num.append(count)
        j=j+1

max_num=max(num)
print(max_num)

Submission status: Runtime Error

Solution code:
ans=0
for s not in raw_input():
  if s in "ACGT":
    ans+=1
print ans

Submission status: Runtime Error

Solution code:
S = input()
S_list = list(S)
answers = []
acgt = 0
for s in S_list:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        acgt += 1
    else:
        answers.append(acgt)
        acgt = 0
print(max(answers))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ans=0
for s in raw_input():
  if s in “ACGT”:
    ans+=1
print ans

Submission status: Runtime Error

Solution code:
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
print(max(anss))

Submission status: Runtime Error

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

import sys

def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    tokens = lines[0].split(" ")
    s = tokens[0]

    return (s,)


def solve(s):
    
    acgt = set(["A", "C", "G", "T"])

    count = 0
    count_set = set()
    for i, c in enumerate(s):
        if c in acgt:
            count = count + 1
        else:
            count_set.add(count)
            count = 0

    return max(count_set)

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()

ls = []
isnAGCT = False
cnt = 0
for i in range(len(n)):
  if n[i] == 'A' or n[i] == 'G' or n[i] == 'C' or n[i] == 'T':
    cnt += 1
    ls.append(cnt)
  else:
    cnt = 0
    
print(max(ls))

Submission status: Runtime Error

Solution code:
n=input()
ans=0
anss=[]
for i in range(len(n)):
    
    if n[i] == "A" or n[i] == "T" or n[i] == "G" or n[i] == "C":
        ans += 1
    else:
        anss.append(ans)
        ans=0
import numpy as np
anss=np.array(anss)
print(anss.max())

Submission status: Runtime Error

Solution code:
#coding: utf-8
S = list(input())
enki = ["A", "T", "G", "C"]
cnt = 0
index = 0
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
        a.append(ans)
    else:
        ans = ""
print(len(max(a)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0

if if len(list)==0:
    print(0)
else:
    print(max(list))

Submission status: Runtime Error

Solution code:

S = list(input())
ACGT = []
lentemp = 0
while len(S)>0:
    s = S.pop(0)

    if s == "A" or s == "C" or s == "G" or s == "T":
        lentemp += 1

    else:
        ACGT.append(lentemp)
        lentemp = 0

print(max(ACGT))

Submission status: Runtime Error

Solution code:
string_list = list(input())
string_len = len(string_list)
renzoku_list = []

def find_letter():
  renzoku = 0
  for i in range(string_len):
    if string_list[i]=='A':
      renzoku += 1
    elif string_list[i]=='C':
      renzoku += 1
    elif string_list[i]=='G':
      renzoku += 1
    elif string_list[i]=='T':
      renzoku += 1
    else:
      renzoku_list.append(renzoku)
      renzoku = 0

if 'A' in string_list:
  find_letter()
elif 'C' in string_list:
  find_letter()
elif 'G' in string_list:
  find_letter()
elif 'T' in string_list:
  find_letter()
else:
  print(0)
  
max_len = max(renzoku_list)
print(max_len)

Submission status: Runtime Error

Solution code:

N = input()
charlist = list(N)
hoge = 0
maxscore = 0
def onon(char, hogehoge):
    nowscore = 0
    while char[hogehoge] == "A" or char[hogehoge] == "T" or char[hogehoge] == "G" or char[hogehoge] == "C" :
        hogehoge = hogehoge + 1
        nowscore += 1
    return nowscore 
for i in charlist:
    score = 0
    if i == "A" or i == "T" or i == "G" or i == "C"  :
        score = onon(charlist,hoge)
    if maxscore <= score:
        maxscore = score
    hoge = hoge + 1
print(maxscore)

Submission status: Runtime Error

Solution code:
S=input()
judge=''
L=len(S)
for index in range(L):
    moji=S[index]
    if (moji=='A') or (moji=='G') or (moji=='T') or (moji=='C'):
        judge+='X'
    else:
        judge+='W'
#print(judge)
num_keeper=[]
num=0
for index in range(L):
    J=judge[index]
    if index==0 and J=='X':
        num=1
    elif J=='W':
        num_keeper.append(num)
        num=0
    else:
        num+=1
    #print(num)
print(max(num_keeper))

Submission status: Runtime Error

Solution code:
s = input()
#print(s)
#print(len(s))
ans = []
cnt = 0
for i in range(len(s)):
  #print(s[i])
  if (s[i] != 'A') and (s[i] != 'T') and (s[i] != 'C') and (s[i] != 'G'):
    ans.append(cnt)
    #print(ans)
    cnt = 0
  elif s[i] == 'A':
    cnt += 1
    continue
  elif s[i] == 'T':
    cnt += 1
    continue
  elif s[i] == 'C':
    cnt += 1
  elif s[i] == 'G':
    cnt += 1
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
list = []

for c in S:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    count+=1
  else:
    list.append(count)
    count = 0

if not list:
    print(0)
else
    print(max(list))

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
s = list(input())
renzoku = 0
renli = []
for i in s:
    if i == "A" or i == "T" or i == "C" or i == "G":
        renzoku += 1
        renli.append(renzoku)
    else:
        renzoku = 0
print(max(renli))

Submission status: Runtime Error

Solution code:
#coding: utf-8
S = list(input())
enki = ["A", "T", "G", "C"]
cnt = 0
index = 0
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        a.append(ans)
        ans = ""
print(len(max(a)))

Submission status: Runtime Error

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

cnt = 0
cntli = []
for i in range(len(s)):
    if s[i] in li:
        cnt += 1
    else:
        cntli.append(cnt)
        cnt = 0

print(max(cntli))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
a = 0
for s in S.split(''):
  if s == 'A' or s == 'C' or s == 'G' or s == 'T':
    count += 1
  else:
    if a < count:
      a = count
    count = 0
print(a)

Submission status: Runtime Error

Solution code:
enki = {"A":"T", "C":"G", "G":"C", "T":"A"}
print(enki[str(input())])