TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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`.

Submission attempts (in order):
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)

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+1)
            j+=1
            if i+j==len(S):
                break
print(max_count)


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
ACGT = ['A','C','G','T']
l,count = 0,0
for i in range(len(s)):
	if ACGT.find(s[i]) >= 0:
		count += 1
	else:
		if l < count:
			l = count
		count = 0
print(l)

ACGT = ['A','C','G','T']
s = input() + 'X'
l,count = 0,0
for i in range(len(s)):
	if s[i] in ACGT:
		count += 1
	else:
		if l < count:
			l = count
		count = 0
print(l)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
letters = ["A","G","C","T"]
counter = 0
record = 0

for letter in s:
    if letter in letters:
        counter += 1
    else:
        counter = 0
else:
    record = max(record,counter)
    print(record)

s = input()
letters = ["A","G","C","T"]
counter = 0
record = 0

for letter in s:
    if letter in letters:
        counter += 1
    else:
        record = max(record,counter)
        counter = 0

record = max(record,counter)

print(record)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
max_re = 0
for i in range(len(s)):
    tar_s = s[i:]
    tar_s = re.search(r'(A|T|C|G)*', tar_s).group()
    max_re = max(max_re, len(tar_s))
print(max_re)

import re
s = input()
max_re = 0
for i in range(len(s)):
    tar_s = s[i:]
    tar_s = re.search(r'(A|T|C|G)*', tar_s).group()
    max_re = max(max_re, len(tar_s))
print(max_re)


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
b = input()
 
if  "A"==b
    print("T")
elif "C"==b
    print("G")
elif "T"==b
    print("A")
else:
    print("C")

S = input()
count = 0
num = 0


for i in S:
    if i=="A" or i=="C" or i=="G" or i=="T":
         count = count + 1
         if count >= num:
             num = count
    else:
        count = 0

print(num)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n= input()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(ans,temp)
print(ans)

n= input()
ans,temp = 0,0
for x in n:
    if x in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(ans,temp)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import re
s = input()
target = re.sub('[^ACGT]', '@', s)
print(target)
num_list = []
for t in target.split('@'):
  num_list.append(len(t))
print(max(num_list))

# -*- coding: utf-8 -*-
import re
s = input()
target = re.sub('[^ACGT]', '@', s)
num_list = []
for t in target.split('@'):
  num_list.append(len(t))
print(max(num_list))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
sl = len(s)
dic = {"A":1,"C":1,"G":1,"T":1}
cntmax = 0
for i in range(sl):
    cnt=0    
    for j in range(sl):
        try :
            cnt += dic[s[j]]
        except KeyError:
            if cntmax < cnt:
                print(str(i)+" "+str(j)+" "+str(cntmax)+" "+str(cnt))
                cntmax = cnt
print(cntmax)


s = input()
sl = len(s)
dic = {"A":1,"C":1,"G":1,"T":1}
cntmax = 0
for i in range(sl):
    cnt=0    
    for j in range(i,sl):
        try :
            # print(str(cnt) +" "+ s[j])
            cnt += dic[s[j]]
        except KeyError:
            # print(s[j])
            if cntmax < cnt:
                # print(str(i)+" "+str(j)+" "+str(cntmax)+" "+str(cnt))
                cntmax = cnt
            break
    if cntmax < cnt:
        cntmax = cnt
print(cntmax)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    for c in S[i:j+1]:
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
acgt = []
cnt = 0
for a in s:
    if a == 'A' or a == 'C' or a == 'T' or a == 'G':
        cnt += 1
    else:
        acgt.append(cnt)
        cnt = 0
acgt.appen(cnt)
print(max(acgt))
        

s = input()
acgt = []
cnt = 0
for a in s:
    if a == 'A' or a == 'C' or a == 'T' or a == 'G':
        cnt += 1
    else:
        acgt.append(cnt)
        cnt = 0
acgt.append(cnt)
print(max(acgt))
        

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()+"O"
tmp=""
ans=[]
for i in s:
  if i in ["A","T","G","C"]:
    tmp=tmp+i
  else:
    ans.append(tmp)
    tmp=""
res=""
for i in ans:
  if len(i)>len(res):
    res=i
print(res)


s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
    if all(["ACGT",count(c) == 1 for c in s[i:j+1]]):
      ans=max(ans,j+1-i)
print(ans)

s=input()+"O"
tmp=""
ans=[]
for i in s:
  if i in ["A","T","G","C"]:
    tmp=tmp+i
  else:
    ans.append(tmp)
    tmp=""
res=0
for i in ans:
  if len(i)>len(res):
    res=len(i)
print(res)


s=input()+"O"
tmp=""
ans=[]
for i in s:
  if i in ["A","T","G","C"]:
    tmp=tmp+i
  else:
    ans.append(tmp)
    tmp=""
res=0
for i in ans:
  if len(i)>res:
    res=len(i)
print(res)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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`.

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

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

s = input()
seq = 0
ans = 0
for c in s:
    if c in 'ACGT':
        seq += 1
        ans = max(ans, seq)
    else:
        seq = 0
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
ans = ''
t = ''
acgt = 'ACGT'
for s in S:
    if (s in acgt):
        t += s
    else:
        if (len(ans) < len(t)):
            ans = t

if (len(ans) < len(t)):
    ans = t
print(ans)

s = input()
ans = 0
for i in range(len(s)):
    for j in range(i+1,len(s)+1):
        t = s[i:j]
        if (all(map(lambda x:x in ['A','C','G','T'],t))):
            ans = max(len(t),ans)
print(ans)

        




Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
ACGT = 'ACGT'
ans = 0
cnt = 0
for i in s:
  if i in ACGT:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans,cnt)


s = input()
ACGT = 'ACGT'
ans = 0
cnt = 0
for i in s:
  if i in ACGT:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(max(ans,cnt))


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = list(input())

res = 0
max = 0
for i in s:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    res += 1
  elif max <res:
    max = res
    res = 0
  else:
    res = 0

if max < res:
  max = res
-
print(max)

s = list(input())

res = 0
max = 0
for i in s:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    res += 1
  elif max <res:
    max = res
    res = 0
  else:
    res = 0

if max < res:
  max = res

print(max)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            break
    else:
        count_max = max(count_max, count_s)
        print(count_max)
        count_s = 0

count_max = max(count_max, count_s)
print(count_max)


s = input()

acgt_s = "ACGT"
count_s = 0
count_max = 0

for i in s:
    for j in acgt_s:
        if j == i:
            count_s += 1
            count_max = max(count_max, count_s)
            break
    else:
        count_s = 0


print(count_max)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
b=input()
if b=="A":
    print("T")
if(b=='T'):
    print('A')
if(b=='G'):
    print('C')
if(b=='C'):
    print('G')

def solve(string):
    ans = 0
    i = 0
    while i < len(string):
        j = 0
        while i + j < len(string) and string[i + j] in "ATGC":
            j += 1
        ans = max(ans, j)
        i += j + 1
    return str(ans)
 
 
if __name__ == '__main__':
    print(solve(input()))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()

st = 'ACGT'
ans = 0
cur = 0
for x in s:
  if x in st:
    cur += 1
  else:
    cur = 0
  ans = max(cur, ans)

s = input()

st = 'ACGT'
ans = 0
cur = 0
for x in s:
  if x in st:
    cur += 1
  else:
    cur = 0
  ans = max(cur, ans)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l-i+1):
    t=s[i:i+j]
    for k in range(j):
      if t[k]=='A' or t[k]=='C' or t[k]=='G' or t[k]=='T':
        continue
      else:
        break
    else:
      ans=max(ans,j)

s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l):
    t=s[i:i+j]
    for k in range(j):
      if t[k] not in ['A','C','G','T']:
        break
    else:
      ans=max(ans,j-i+1)
print(ans)

s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l-i+1):
    t=s[i:i+j]
    for k in range(j):
      if t[k]=='A' or t[k]=='C' or t[k]=='G' or t[k]=='T':
        continue
      else:
        break
    else:
      ans=max(ans,j)
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] = 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] == 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

Verdicts: Runtime Error

Accepted
Problem: 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`.

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()

ans=0

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

S=input()
n=len(S)
ans=0

for i in range(n):
    for j in range(i,n):
        if S[i:j+1].count(("A","C","G","T"))==j-i+1:
            ans=max(ans,j-i+1)
print(ans)

S=input()
n=len(S)
ans=0

for i in range(n):
    for j in range(i,n):
        if S[i:j+1].count("A","C","G","T")==j-i+1:
            ans=max(ans,j-i+1)
print(ans)

S=input()
n=len(S)
ans=0

no=False
for i in range(n):
    for j in range(i,n):
        for k in range(i,j+1):
            if not S[k] in ("A","C","G","T"):
                no=True
                break
        if no:
            no=False
            break
        ans=max(ans,j-i+1)
print(ans)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys

input = sys.stdin.readline

s = list(input().rstrip())

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

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = 'う～えす～ぎさ～ん'


ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'う～えす～ぎさ～ん'):
        ct += 1
    else:
        ct_lis.append([ct])
        ct = 0

print(max(ct_lis))


import sys

input = sys.stdin.readline

s = list(input().rstrip())

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

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = '!'
            break

print(s)
ct = 0
ct_lis = []

for i, x in enumerate(s):
    print(ct_lis)
    if (x == '!'):
        ct += 1
    else:
        ct_lis.append(ct)
        ct = 0

ct_lis.append(ct)

print(max(ct_lis))


import sys

input = sys.stdin.readline

s = list(input().rstrip())

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

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = 'AYATASO'
            break

ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'AYATASO'):
        ct += 1
    else:
        ct_lis.append(ct)
        ct = 0

ct_lis.append(ct)

print(max(ct_lis))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
cnt = 0
cnt_list = [0]*len(s)
for i in s:
    if s in 'ACTG ':
        cnt +=1
    else:
        cnt = 0
    cnt_list[i] = cnt
print(max(cnt_list))

s = input()
cnt = 0
cnt_list = [0]*len(s)
for idx,i in enumerate(s):
    if i in 'ACTG ':
        cnt +=1
    else:
        cnt = 0
    cnt_list[idx] = cnt
print(max(cnt_list))

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
def function(S):
    ACGT = ['A', 'C', 'G, 'T']
    ret = 0
    N = len(S)
    for i in range(0, N):
        for j in range(i+1, N+1):
            temp = 0
            l = S[i:j]
            for x in l:
                if x not in ACGT:
                    break
            temp = len(l)
    	if temp >= ret:
        	ret = temp
    return ret

def function(S):
    ACGT = ['A', 'C', 'G', 'T']
    ret = 0
    N = len(S)
    for i in range(0, N):
        for j in range(i+1, N+1):
            temp = 0
            l = S[i:j]
            for x in l:
                if x not in ACGT:
                    break
            temp = len(l)
            if temp >= ret:
                ret = temp
    return ret

S = input()
print(function(S))


def function(S):
    ACGT = ['A', 'C', 'G, 'T']
    ret = 0
    N = len(S)
    for i in range(0, N):
        for j in range(i+1, N+1):
            l = S[i:j]
            for x in l:
                if x not in ACGT:
                    break
            ret = len(l)
    return ret

def function(S):
    ACGT = ['A', 'C', 'G', 'T']
    ret = 0
    N = len(S)
    for i in range(0, N):
        for j in range(i+1, N+1):
            temp = 0
            l = S[i:j]
            for x in l:
                if x not in ACGT:
                    break
            temp = len(l)
        if temp >= ret:
            ret = temp
    return ret

S = input()
print(function(S))

def function(S):
    ACGT = ['A', 'C', 'G', 'T']
    ret = 0
    N = len(S)
    for i in range(0, N):
        for j in range(i+1, N+1):
            temp = 0
            l = S[i:j]
            const = 0
            for x in l:
                if x not in ACGT:
                    const = 1
                    break
            if const == 1:
                break
            temp = len(l)
            if temp >= ret:
                ret = temp
    return ret

S = input()
print(function(S))


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
lst = ['A', 'C', 'G', 'T']
word = input()

lst2 = []
lst3 = []
lst4 = []
lst5 = []
lst6 = []
lst7 = []
lst8 = []
lst9 = []
lst10 = []
for s1 in lst:
  for s2 in lst:
    lst2.append(s1+s2)
    for s3 in lst:
      lst3.append(s1+s2+s3)
      for s4 in lst:
        lst4.append(s1+s2+s3+s4)
        for s5 in lst:
          lst5.append(s1+s2+s3+s4+s5)
          for s6 in lst:
            lst6.append(s1+s2+s3+s4+s5+s6)
            for s7 in lst:
              lst7.append(s1+s2+s3+s4+s5+s6+s7)
              for s8 in lst:
                lst8.append(s1+s2+s3+s4+s5+s6+s7+s8)
                for s9 in lst:
                  lst9.append(s1+s2+s3+s4+s5+s6+s7+s8+s9)
                  for s10 in lst:
                    lst10.append(s1+s2+s3+s4+s5+s6+s7+s8+s9+s10)
if word in lst10:
  print(10)
elif word in lst9:
  print(9)
elif word in lst8:
  print(8)
elif word in lst7:
  print(7)
elif word in lst6:
  print(6)
elif word in lst5:
  print(5)
elif word in lst4:
  print(4)
elif word in lst3:
  print(3)
elif word in lst2:
  print(2)
elif word in lst:
  print(1)
else:
  print(0)

words = input()

lst = ['A', 'C', 'G', 'T']
max_count = 0
count = 0
for i in range(len(words)):
  if words[i] in lst:
    count += 1
    if i == len(words) - 1:
      if count > max_count:
        max_count = count
  else:
    if count > max_count:
      max_count = count
    count = 0
print(max_count)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = str(input())


if ("A" not in s) and ("C" not in s) and ("G" not in s) and ("T" not in s):
    print 0

max = 0
for i, c in enumerate(s):
    if is_ACGT(c):
        if i == (len(s) - 1):
            break
        max = get_ACGT_length(s[i+1:])

print(max)

def is_ACGT(c):
    if (c == "A") or (c == "C") or (c == "G") or (c == "T"):
        return True
    else:
        return False

def get_ACGT_length(s):
    if len(s) == 0:
        return 0

    if not is_ACGT(s[0]):
        return 0

    if len(s) == 1:
        return 1
    return 1 + get_ACGT_length(s[1:])


def is_ACGT(c):
    if (c == "A") or (c == "C") or (c == "G") or (c == "T"):
        return True
    else:
        return False

def get_ACGT_length(s):
    if len(s) == 0:
        return 0

    if not is_ACGT(s[0]):
        return 0

    return 1 + (get_ACGT_length(s[1:]))


s = str(input())

result = 0
for i, c in enumerate(s):
    if is_ACGT(c):
        result = max(get_ACGT_length(s[i:]), result)

print(result)


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
# coding: utf-8
# submission # - User: herp_sy


import math
import statistics

s = input()
ans = 0
for i in range(n):
  for j in range(i, n):
    if all('ACGT'.count(c) == 1 for c in s[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)


# coding: utf-8
# submission # - User: herp_sy


import math
import statistics

s = input()
ans = 0
for i in range(n):
  for j in range(i, n):
    if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
      ans = max(ans, j - i + 1)
print(ans)


# coding: utf-8
# submission # - User: herp_sy


import math
import statistics

s = input()
length = 0
ans = 0
for ch in s:
    if ch in ('A','C','G','T'):
        length += 1
        ans = max(ans, length)
    else:
        length = 0
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()

max_score = 0
score = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    score += 1
    if max_score <= score:
      max_score = score
  else:
    if max_score <= score:
      max_score = score
    score = 0
  print(max_score,score)
 
      
print(max_score)

s = input()

max_score = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    score += 1
  else:
    if max_score < score:
      max_score = score
    score = 0

      
print(max_score)

s = input()

max_score = 0
score = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    score += 1
    if max_score <= score:
      max_score = score
  else:
    if max_score <= score:
      max_score = score
    score = 0
  
 
      
print(max_score)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
ans = 0
tmp = 0
acgt = ['A', 'C', 'G', 'T']
while s:
  if s.pop(0) in acgt:
    tmp += 1
  else:
    ans = max([ans, tmp])
    tmp = 0

ans = max([ans, tmp])
print(ans)

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

ans = max([ans, tmp])
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
#ABC 122, B - ATCoder
S = input()
N = len(S)

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


#ABC 122, B - ATCoder
S = input()
N = len(S)

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


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
import re
S = input()
if not ( 1 <= len(S) <= 10 ): sys.exit()
if not S.isupper: sys.exit()

max = max(re.findall('[A|T|G|C]+', S)) if re.findall('[A|T|G|C]+', S) else 0
if max > 0:max
print(max)

import sys
import re
S = input()
if not ( 1 <= len(S) <= 10 ): sys.exit()
if not S.isupper: sys.exit()

result = 0
max = max(re.findall('[A|T|G|C]+', S),key=len) if re.findall('[A|T|G|C]+', S) else ''
if len(max) > 0:result = len(max)
print(result)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
res = 0
count = 0
for s in S:
    if s in ['A', 'C', 'G', 'T']:
        print(s)
        count += 1
    else:
        count = 0
    res = max(count, res)

print(res)


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

print(res)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
count = 0
count_max = 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
        continue
    else:
        max(count_max,count)
        count = 0
        
print(count_max)

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

S = input()
count = 0
count_max = 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
        continue
    else:
        max(count_max,count)

print(count_max)

S = input()
count = 0
count_max = 0
for i in range(len(S)):
    if S[i] in 'ACGT':
        count += 1
        continue
    else:
        max(count_max,count)
        count = 0

print(count_max)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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))

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))

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))

# -*- 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))

# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
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))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
acgt = ["A","C","G","T"]
for i in range(len(S)):
    tmp = 0
    if S[i] in acgt:
        tmp += 1
        for j in range(i+1,len(S)):
            if S[j] in acgt:
                tmp += 1
                continue
            else:
                print(S[i:j])
                tmp =max(tmp, j-i)
                break
print(tmp)

S = input()
tmp = 0
acgt = ["A","C","G","T"]
for i in range(len(S)):
    if S[i] in acgt:
        for j in range(i+1,len(S)):
            print(S[i:j])
            if S[j] in acgt:
                continue
            else:
                tmp =max(tmp, j-i)
                break
print(tmp)

S = input()
tmp = 0
acgt = ["A","C","G","T"]
for i in range(len(S)):
    if S[i] in acgt:
        for j in range(i+1,len(S)):
            if S[j] in acgt:
                continue
            else:
                print(tmp,j-i)
                tmp =max(tmp, j-i)
                break
print(tmp)

S = input()
for i in range(len(S)):
    if S[i] == "A" or "C" or "G" or "T":
        for j in range(i+1,len(S)):
            if S[j] == "A" or "C" or "G" or "T":
                continue
            else:
                tmp = j-i
                break
print(tmp)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s="AAAAAAAAAA"

def sea(s):
    if s==[]:
        return 0
    max_agct=0
    tem_agct=0
    for i in range(len(s)):
        for j in range(len(s)-i):
            if s[i+j]=="A" or s[i+j]=="G" or s[i+j]=="C" or s[i+j]=="T":
                tem_agct+=1
          
                        
            else:
                if tem_agct>max_agct:
                    max_agct=tem_agct
                tem_agct=0
                break
                
        if i+j==len(s)-1:
            if tem_agct>max_agct:
                max_agct=tem_agct
            break
                    
    return max_agct

print(sea(s))
               

s=list(input())

def sea(s):
    if s==[]:
        return 0
    max_agct=0
    tem_agct=0
    for i in range(len(s)):
        for j in range(len(s)-i):
            if s[i+j]=="A" or s[i+j]=="G" or s[i+j]=="C" or s[i+j]=="T":
                tem_agct+=1
          
                        
            else:
                if tem_agct>max_agct:
                    max_agct=tem_agct
                tem_agct=0
                break
                
        if i+j==len(s)-1:
            if tem_agct>max_agct:
                max_agct=tem_agct
            break
                    
    return max_agct

print(sea(s))
               

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)

ans = 0
c = 1
li = ["A","C","G","T"]
s = input()
lens = len(s)
for i in range(lens):
    for j in range(lens-(i)):
        a = s[j:j+i+1]
        for k in range(i+1):
            if a[k] not in li:
                c = 1
                break
            else:
                c = 0
                continue
        if c == 0:
            ans = i+1
        else:
            c = 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
A = list(input())
S = ['A','C','G','T']
count = 0
a = []
a.append(count)
for i in A:
  if i in S:
    count += 1
    print(count)
    a.append(count)
  else:
    count = 0
print(max(a))

A = list(input())
S = ['A','C','G','T']
count = 0
a = []
a.append(count)
for i in A:
  if i in S:
    count += 1
    a.append(count)
  else:
    count = 0
print(max(a))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
res=0
for i in range(len(s)+1):
    for j in range(i+1,len(s)+1):
        print(list(s[i:j]))
        if set(list(s[i:j]))|{'A','G','C','T'}=={'A','G','C','T'}:
            cnt=len(s[i:j])
        if res<cnt:
            res=cnt

print(res)

s=input()

res=0
for i in range(len(s)+1):
    for j in range(i+1,len(s)+1):
        cnt=0
        for x in s[i:j]:
            if x not in ['A','G','C','T']:
                break
            cnt+=1
        if res<cnt:
            res=cnt

print(res)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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)



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)



Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
ans = 0
count = 0


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

S = input()
ans = 0
count = 0


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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()

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

max_count = 0
count = 0
for i in range(len(S)):
    print(count)
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
max_count = max(max_count,count)
print(max_count)

S = input()

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
print(max_count)

S = input()

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

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
max_count = max(max_count,count)
print(max_count)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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))

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)

b = input()
let = 'ATGC'
prev = b[0]
high = 0
leng = 0
stop = False

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:
        leng += 1
        stop = False
    else:
        stop = True
        if leng > high:
            high = leng
            leng = 0
    prev = b[i]
    
if not stop:
    if leng > high:
        high = leng
    
print(high)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()

cnt = 0
ans = 0

for ss in S:
    if ss in 'ACGT':
        len += 1
    else:
        len = 0
    ans = max(ans,len)
    
print(ans)

S = input()

cnt = 0
ans = 0

for ss in S:
    if ss in 'ACGT':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans,cnt)
    
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n = len(S)
ans_list = []
for i in range(n):
    for j in range(i + 1, n):
        T = S[i: j + 1]
        U = T.replace("A","").replace("C","").replace("G","").replace("T","")
        if U == "":
            ans_list.append(len(T))
print(max(ans_list))

S = list(input())
ans, p = 0, ""
for s in S:
    if s in ["A", "C", "G", "T"]:
        p += s
    else:
        p = ""
    ans = max(ans, len(p))
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
a=input()
count=0
s=0
for i in range(len(a)):
    if i==0 or i==len(a)-1:
        pass
    else:
        if a[i]=='A' or a[i]=='C' or a[i]=='G' or a[i]=='T':
            count+=1
            s=count
        else:
            if count>s:
                s=count

        
        
            count=0
print(s)


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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import re

S = input()

print(max(re.findall('[ATCG]+', S)))

import re

S=input()

ans=0
for i in range(10):
  for j in range(i,10+1):
    str=S[i:j]
    if re.search(r'^[AGCT]+$' ,str):
      ans=max(ans,len(str))

print(ans)
    

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
mx, h = [], []
for ch in input():
    print(h)
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
str = input()
S = list(str)

ans = 0
num = 0

for i in range(len(str)):
  if list[i] == "A" or list[i] == "G" or list[i] == "T" or list[i] == "C":
    num = 1
    for j in range(len(str)):
      list[j] == "A" or list[j] == "G" or list[j] == "T" or list[i] == "j":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)

str = input()
S = list(str)

ans = 0
num = 0

for i in range(len(str)):
  if list[i] == "A" or list[i] == "G" or list[i] == "T" or list[i] == "C":
    num = 1
    for j in range(len(str)):
      if list[j] == "A" or list[j] == "G" or list[j] == "T" or list[i] == "C":
        num = num + 1
      else :
        break
  if ans < num :
    ans = num
  num = 0
  
print(ans)

str = input()
S = list(str)

ans = 0
num = 0

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S=list(input())
li = ['A','T','G','C']
maxl=0
ans=0
for i in range(len(S)):
    if S[i] in li:
        leng+=1
    else:
        if leng>maxl:
            maxl=leng
        leng=0
print(maxl)

S=list(input())
li = ['A','T','G','C']
ans=0
leng=0
for i in range(len(S)):
    if S[i] in li:
        leng+=1
    else:
        leng=0
    if leng>ans:
        ans=leng
print(ans)

Verdicts: Runtime Error

Accepted