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

c = 0
ans = 0

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

print(ans)

S = list(input())
L = ['A','C','G','T']
c = 0
ans = 0

for i in S:
    if i in L:
        c += 1
        ans = max(ans,c)
    else:
        c = 0

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()
S+="b"
print(S)
ans=0
now=0
l=[i for i in "ACGT"]

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

print(ans)

s=input()
cnt=0
ans=0
lit=["A","C","G","T"]
for i in range(len(s)):
  if s[i] in lit:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
ans=max(cnt,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):
if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))

def all_part_string(s):
    r = range(len(s))
    return [s[i:j+1] for i in r for j in r if s[i:j+1] != '']

def contains_only(s, l):
    return False if [a for a in [e for e in s if e not in l] if a != ''] else True

if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))


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

S = input()
start = 0
max = 0
count = 0
for i in range(len(S)):
    if(S[i] != "A")&(S[i] != "T")&(S[i] != "G")&(S[i] != "C"):
        if max < count:
            max = count
        count = 0
    else:
        count = count + 1
if ((S[i] == "A")|(S[i] == "T")|(S[i] == "G")|(S[i] == "C"))&(max < count):
    max = count
print(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):
import re

S=input()
pat = r'[ATCG]+'
parts = re.findall(pat,S)
print 0 if len(parts)==0 else max([len(part) for part in parts])

import re

S=input()
pat = r'[ATCG]+'
parts = re.findall(pat,S)
if len(parts)==0:
  print(0) 
else:
  print(max([len(part) for part in parts]))

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):
judge = ['A','G', 'C', 'T']
string_list = [i in judge for i in input()]
string = ''.join(string_list).split('False')
print(max([i.count('True') for i in string]))


count = 0
counter = 0
for i in input():
  if i in ['A', 'G', 'C', 'T']:
    counter += 1
    count = max(count, counter)
  else:
    counter = 0
print(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):
a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
  if a[i]!="A" and a[i]!="C" or a[i]!="G" or a[i]!="T":
    b=0
  if c<b:
    c=b
print(c)

a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
    if c<b:
      c=b
  if a[i]!="A" and a[i]!="C" and a[i]!="G" and a[i]!="T":
    b=0
print(c)

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())
mx = 0
for i in range(n):
    for j in range(i+1,n+1):
        cnt = j-i-1
        p = 0
        for k in list(s[i:j]):
            if k in ["A","C","G","T"]:
                p += 1
        if p == cnt:
            if p > mx:
                mx = p
print(mx)

s = str(input())
mx = 0
for i in range(len(s)):
    for j in range(i+1,len(s)+1):
        cnt = j-i
        p = 0
        for k in list(s[i:j]):
            if k in ["A","C","G","T"]:
                p += 1
        if p == cnt:
            if p > mx:
                mx = p
print(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):
import re

s = input()
l = re.findall('[ACGT]*', s)
print(l)

import re

s = input()
l = re.findall('[ACGT]*', s)
print(len(max(l,key=len)))

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):
L = ['A','C','G','T']
S = list(input()) 
S = ['1' if ((i in L) == True) else '0' for i in S]
S = ''.join(S_list)
S = S.split('0')
S = [len(i) for i in S]
print(max(S))

L = ['A','C','G','T']
S = list(input()) 
S = ['1' if ((i in L) == True) else '0' for i in S]
S = ''.join(S)
S = S.split('0')
S = [len(i) for i in S]
print(max(S))

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 = list(input())
N = len(S)
li = []
agct = ["A","G","C","T"]   
ans=0
for i in range(N):
    if S[i] in agct:
        li.append(1)
    else:
        li.append(0)

from itertools import groupby

dst = [sum(1 for r in s) for t, s in groupby(li, key=lambda x: x == 1)]
print(max(dst))

s = input()
L = "ACGT"
ans = ""
ss = ""
for i in range(len(s)):
  if s[i] in L:
    ans += s[i]
    print(ans,ss)
  else:
    if len(ans)>len(ss):
      
      ss = ans
      ans = ""
print(len(ss))

s = input()
L = "ACGT"
ans = ""
ss = ""
for i in range(len(s)):
  if s[i] in L:
    ans += s[i]
    if i == len(s)-1:
        if len(ans)>len(ss):
            ss = ans
            #print(len(ss))
  else:
    if len(ans)>len(ss):
      
      ss = ans
      #print(ans,ss)
      ans = ""
print(len(ss))

Verdicts: 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())
max_count = 0
count = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'AT' or S[i] == 'G' or S[i] == 'C':
    count = count + 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(count)

S=str(input())
max_count = 0
count = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'AT' or S[i] == 'G' or S[i] == 'C':
    count = count + 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)


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


Verdicts: 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 = input()
a = 0
b = 0
for i in len(s):
    if i in 'ATGC':
        ans += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

s = input()
a = 0
b = 0
for i in len(s):
    if i in 'ATGC':
        a += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

s = input()
a = 0
b = 0
for i in s:
    if i in 'ATGC':
        a += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

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_l = 0
temp_l = 0

for s in S:
    if s == 'A' or s=='G' or s=='C' or s=='T':
        temp_l += 1
        
    else:
      	max_l = max(max_l, temp_l)
        temp_l = 0

print(max_l)


S = input()
max_l = 0
temp_l = 0

for s in S:
    if s == 'A' or s=='G' or s=='C' or s=='T':
        temp_l += 1
        max_l = max(max_l, temp_l)
    else:
        temp_l = 0

print(max_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()
count=0
count_list=[]
seq=["A","T","G","C"]
for base in ref:
    if base in seq:
        count +=1
    else:
        count_list.append(count)
        count = 0
    count_list.append(count)
print(max(count_list))

s = input()
list0 = ['A', 'C', 'G', 'T']
list1 = []
frag = 0
for i in s:
  if i in list0:
    frag += 1
  else:
    if frag != 0:
      list1.append(frag)
    frag = 0
list1.appned(0)
print(max(list1))

s=input()
count=0
count_list=[]
seq=["A","T","G","C"]
for base in s:
    if base in seq:
        count +=1
    else:
        count_list.append(count)
        count = 0
    count_list.append(count)
print(max(count_list))

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 = 0
count = 0

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

print(max(max, count))


s = input()
max_count = 0
count = 0

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

print(max(max_count, 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):
S = list(input())
st = [0]*len(S)
string = "ACGT"
for i in range(len(S)):
    if S[i] in string:
        st[i] += 1

st_1 = [1]*len(S)

count = []
temp = 0

for i in range(len(st)):
    if st[i] == st_1[i]:
        temp += 1
    else:
        count.append(temp)
        temp = 0
    if i+1 == len(st):
        count.append(temp)
        
print(st)
if count:
    print(max(count))
else:
    print(0)

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


if index:
    diff = [index[0]]
    for j in range(len(index)-1):
        diff.append(index[j+1] - index[j] - 1)
    print(max(diff))
    
else:しない
    print(len(S))



S = list(input())
st = [0]*len(S)
string = "ACGT"
for i in range(len(S)):
    if S[i] in string:
        st[i] += 1

st_1 = [1]*len(S)

count = []
temp = 0

for i in range(len(st)):
    if st[i] == st_1[i]:
        temp += 1
    else:
        count.append(temp)
        temp = 0
    if i+1 == len(st):
        count.append(temp)
        
#print(st)
if count:
    print(max(count))
else:
    print(0)

Verdicts: 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):
a = list(input())
b = ""
c = ""
for i in range(len(a)):
  if(a[i] == "A" or a[i] == "G" or a[i] == "T" or a[i] == "C"):
    b += a[i]
  else:
    if(len(b)>len(c)):
      c = b
      b = ""
print(c)

a = list(input())
b = ""
c = ""
for i in range(len(a)):
  if(a[i] == "A" or a[i] == "G" or a[i] == "T" or a[i] == "C"):
    b += a[i]
    if(len(b)>len(c)):
      c = b
  else:
      b = ""
print(len(c))

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=int(input())
count=0
for i in range(1,n+1):
    if i%2==1:
        yakusuu=0
        for j in range(1,int((i**0.5)//1)+1):
            if i%j==0:
                if j**2==i:
                    yakusuu+=1
                else:
                    yakusuu+=2
        if yakusuu==8:
            count+=1
print(count)

s=list(map(str,input()))
l=[[]]
count=0
for i in s:
    if i=='A' or i=='C' or i=='G' or i=='T':
        l[count].append(i)
    else:
        count+=1
        l.append([])
maxl=0
for j in l:
    if len(j)>maxl:
        maxl=len(j)
print(maxl)

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()
N = len(S)
ACGT = []
others = 'BDEFHIJKLMNOPQRSUVWXYZ'
for i in range(N):
    fl = True
    for j in range(i+1,N+1):
        tmp_S = S[i:j]
        M = len(tmp_S)
        for k in range(M):
            if tmp_S[k] in others:
                fl = False
        if fl==False:
            break
        ACGT.append(tmp_S)
print(ACGT)
len_ACGT = [len(x) for x in ACGT]
print(max(len_ACGT)) if len(len_ACGT)>0 else print(0)

S = input()
N = len(S)
ACGT = []
others = 'BDEFHIJKLMNOPQRSUVWXYZ'
for i in range(N):
    fl = True
    for j in range(i+1,N+1):
        tmp_S = S[i:j]
        M = len(tmp_S)
        for k in range(M):
            if tmp_S[k] in others:
                fl = False
        if fl==False:
            break
        ACGT.append(tmp_S)
print(ACGT)
len_ACGT = [len(x) for x in ACGT]
print(max(len_ACGT)) if len(len_ACGT)>0 else print(0)

S = input()
N = len(S)
ACGT = []
others = 'BDEFHIJKLMNOPQRSUVWXYZ'
for i in range(N):
    fl = True
    for j in range(i+1,N+1):
        tmp_S = S[i:j]
        M = len(tmp_S)
        for k in range(M):
            if tmp_S[k] in others:
                fl = False
        if fl==False:
            break
        ACGT.append(tmp_S)
len_ACGT = [len(x) for x in ACGT]
print(max(len_ACGT)) if len(len_ACGT)>0 else print(0)

Verdicts: 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 = list(input())
c,max = 0,0
for i in range(0,len(s)):
  if s[i] in "ATCG":
    c=1
    for j in range(i,len(s)-1):
      if s[j] in "ATCG":
        if c!=1:
          c+=1
      else:
        break
  if max < c:
    max=c      
print(max) 

s = list(input())
c,max = 0,0
for i in range(0,len(s)):
  if s[i] in "ATCG":
    c=1
    for j in range(i,len(s)):
      if s[j] in "ATCG":
        if j!=i:
          c+=1
      else:
        break
  if max < c:
    max=c      
print(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):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
#print(lo)
if lis[0]>=lo:
  lo=lis[0]
#print(lo)
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
#print(lo)
print(lis,lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]+1>=lo:
  lo=le-lis[-1]-1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]+1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]-1
print(lo)

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if bool(lis):
  if lis[0]>=lo:
    lo=lis[0]
  if le-lis[-1]-1>=lo:
    lo=le-lis[-1]-1
  print(lo)
else:
  print(le)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

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()
n=len(S)
ans=[]
for i in range(n):
  cnt=0
  for j in range(j,n):
    if S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T':
      cnt+=1
  ans.append(cnt)
print(max(ans))

S=input()
H=[]
M=len(S)
an=[]
j=0
for i in range(M):
	if S[i]=="A":
	elif S[i]=='C':
	elif S[i]=='G':
	elif S[i]=='T':
	else:
		H.append(i)
N=len(H)    
for i in range(N)
   an=H[i+1]-H[i]+1
an.append(H[0])

c=Max(an)
print("%d"% c)



S=input()
n=len(S)
ans=[]
for i in range(n):
  j=i
  cnt=0
  while(S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T'):
    cnt+=1
  ans.append(cnt)
print(max(ans))
    

S=input()
n=len(S)
ans=[]
for i in range(n):
  cnt=0
  j=i
  while(S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T'):
      cnt+=1
  ans.append(cnt)
print(max(ans))

s=list(input())
cnt=0
ans=0
l=list("ATCG")
 
for i in s:
    if i in l:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
print(ans)


Verdicts: Runtime Error

Runtime Error

Time Limit Exceeded

Time Limit Exceeded

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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))
print(tmp)

tmp2 = [tmp[i+1] - tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)


import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))
#print(tmp)

tmp2 = [tmp[i+1] - tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)


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 = 0
max_L = 0

for i in len(S):
  s = S[i]
  TF = any(['A'==s, 'C'==s, 'G'==s, 'T'==s])
  if TF:
    L += 1
  elif L >= max_L:
    max_L = L
    L = 0

print(max_L)

S = input()
L = 0
max_L = 0
 
for i in range(len(S)):
  s = S[i]
  TF = any(['A' in s, 'C' in s, 'G' in s, 'T' in s])
  if TF:
    L += 1
    if L >= max_L:
        max_L = L
  elif L >= max_L:
    max_L = L
    L = 0

print(max_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()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmaax)

s = input()
l = 0
lenmax = 0

for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
print(l)

s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmax)

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):
a=0
b=0
for i in range(len(N)):
	if N[i] == 'A' or N[i] ==  'T' or N[i] ==  'C' or N[i] ==  'G' :
		a+=1
	else: 
		if a > b: b = a
		a=0

print(b)


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

print(max(b,a))


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
s = input()
n = len(s)
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)

#B
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):
def main():
    *S, = input()
    count = 0
    max = 0
    for i in S:
        print(i)
        if i == "A" or i == "C" or i == "G" or i == "T":
            count += 1
        else:
            if max < count:
                max = count
            count = 0
    print(max)
main()


def main():
    *S, = input()
    count = 0
    max = 0
    for i in S:
        if i == "A" or i == "C" or i == "G" or i == "T":
            count += 1
        else:
            if max < count:
                max = count
            count = 0
    print(max(count, max))
main()

def main():
    *S, = input()
    count = 0
    maximum = 0
    for i in S:
        if i == "A" or i == "C" or i == "G" or i == "T":
            count += 1
        else:
            if maximum < count:
                maximum = count
            count = 0
    print(max(count, maximum))
main()

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()
cnt = 0
cnt_list = []
for i in range(len(s)):
  if s[i] == "A" or "C" or "G" or "T":
    cnt +=1
  else:
    cnt_list.append(cnt)
  cnt = 0
print(max(cnt_list))
    

s = input()
acgt = ["A","C","G","T"]
cnt = 0
cnt_list = []
for i in range(len(s)):
    if s[i] in acgt:
        cnt +=1
        if s[-1] in acgt:
            cnt_list.append(cnt)
    else:
        cnt_list.append(cnt)
        cnt = 0
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):
import re 
S = input()

p = re.compile('[ATCG]+')
f = p.finditer

candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))

import re 
S = input()
 
p = re.compile('[ATCG]+')
f = p.finditer(S)
 
candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))

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):
result = 0
cnt = 0
b = list(input())
for str in b:
    if b == "A" or b == "T" or b == "C" or b == "G":
        cnt += 1
    else:
        result = max(result,cnt)
        cnt = 0


result = 0
cnt = 0
b = list(input())
for str in b:
    if str == "A" or b == "T" or b == "C" or b == "G":
        cnt += 1
    else:
        result = max(result,cnt)
        cnt = 0


result = 0
cnt = 0
b = list(input())
for str in b:
    if str == "A" or str == "T" or str == "C" or str == "G":
        cnt += 1
        result = max(result,cnt)
    else:
        cnt = 0
print(result)


Verdicts: 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 = input()
agct = ['A','G','C','T']
count = 0
max_count = 0
for i in len(S):
  if S[i] in agct:
    count += 1
  else:
    max_count = max(count,max_count)
print(max_count)

L = ["A","T","C","G"]
S = input()
S += "B"
count = 0
maxcount = 0
for i in S:
  if i in L:
    count += 1
  else:
    maxcount = max(count,maxcount)
    count = 0
print(maxcount)

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):
#122c
N,Q = map(int, input().split())
S = str(input())

for _ in range(Q):
    l,r = map(int, input().split())
    print(S[l-1:r].count('AC'))

S = list(input())
ACGT = set(["A","C","G","T"])
ans = 0
acgt_length = 0

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

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

actg_list=[]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      atcg_list.append(slen)
      
print(max(atcg_list))

S=input()
 
acgt_list=[0]
for i in range(len(S)):
  for j in range(i+1,len(S)+1):
    slen=len(S[i:j])
    temp=0
    for s in S[i:j] :
      if s=='A' or s=='C' or s=='G' or s== 'T':
        temp+=1      
    if temp==slen:
      acgt_list.append(slen)
      
print(max(acgt_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):
s = str(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+1)
print(ans)


s = str(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: 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):
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    strings = input()
    answers=[]
    counter=0

    for string in strings:
        if "A" in string or "C" in string or "G" in string or "T" in string:
            counter+=1
        else:
            answers.append(counter)
            counter=0
    print(max(answers))

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    strings = input()
    answers=[]
    counter=0

    for string in strings:
        if "A" in string or "C" in string or "G" in string or "T" in string:
            counter+=1
        else:
            answers.append(counter)
            counter=0
    print(max(answers))


if __name__=="__main__":
    main()

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 = list(input())
n = len(s_list)
dic = {"A", "C", "G", "T"}
ans = 0
tmp_ans = 0
for i in range(n):
    for j in range(i, n):
        print(s_list[i], s_list[j], tmp_ans, ans)
        if s_list[j] in dic:
            tmp_ans += 1
        else:
            ans = max(ans, tmp_ans)
            tmp_ans = 0
        if j == n - 1:
            ans = max(ans, tmp_ans)
            tmp_ans = 0
print(ans)

s_list = list(input())
n = len(s_list)
dic = {"A", "C", "G", "T"}
ans = 0
tmp_ans = 0
for i in range(n):
    for j in range(i, n):
        print(s_list[i], s_list[j])
        if s_list[j] in dic:
            tmp_ans += 1
        else:
            ans = max(ans, tmp_ans)
            tmp_ans = 0
            break
ans = max(ans, tmp_ans)
print(ans)

s_list = list(input())
n = len(s_list)
dic = {"A", "C", "G", "T"}
ans = 0
tmp_ans = 0
for i in range(n):
    for j in range(i, n):
        if s_list[j] in dic:
            tmp_ans += 1
        else:
            ans = max(ans, tmp_ans)
            tmp_ans = 0
        if j == n - 1:
            ans = max(ans, tmp_ans)
            tmp_ans = 0
ans = max(ans, tmp_ans)
print(ans)

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

alp = 'ACGT'

cnt = []

for i in range(0, N):
    for j in range(i, N+1):
        tmp = S[i:j]
        flg = 0
        for a in alp:
            if a in tmp:
                flg = 1
        if flg:
            cnt.append(len(tmp))

print(max(cnt))


S = input()
N = len(S)

alp = 'ATCG'
cnt = []

for i in range(0, N):
    for j in range(i, N+1):
        tmp = S[i:j]
        if set(alp) >= set(tmp):
            cnt.append(len(tmp))

print(max(cnt))


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

ma = 0
for i in range(len(s)):
    for j in range(0,len(s)-i+1):
        sbstr = s[i:i+j+1]
        print(i,j,sbstr)
        is_good = True
        for c in sbstr:
            if c not in "AGCT":
                is_good = False
                break
        if is_good:
            if (len(sbstr)) > ma :
                ma = len(sbstr)

print(ma)


s = input()

ma = 0
for i in range(len(s)):
    for j in range(1,len(s)-i+1):
        tmp = s[i:i+j]
        # print(i,j,tmp)
        is_good = True
        for c in tmp:
            if c not in "AGCT":
                is_good = False
                break
        if is_good:
            if (len(tmp)) > ma :
                ma = len(tmp)

print(ma)

        

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

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.appned(ans)
    ans = 0
    
print(max(arr))

S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.append(ans)
    ans = 0
    
arr.append(ans)

print(max(arr))


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

max = 0
for i in range(len(S)-1):
    for j in range(i+1, len(S)+1):
        count = 0
        print(S[i:j])
        for char in S[i:j]:
            if char == 'A' or char == 'C' or char == 'G' or char == 'T':
                count += 1
            else:
                count = 0
                break
        if count > max:
            max = count

print(max)

S = input()
max = 0

if len(S) == 1:
    if S == 'A' or S == 'C' or S == 'G' or S == 'T':
        max = 1
    else:
        max = 0
    print(max)
    quit()


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

print(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):
s=input()

if s=='A': 
	res='T'
else:
	if s=='T':
		res='A'
	else:
		if s=='G':
			res='C'
		else:
			res='G'

print(res)

s=input()

n=len(s)
ac=[0]*(n+1)

for i in range(n):
	if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
		ac[i+1]=ac[i]+1

print(max(ac))

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 = list(input())
for i in range(len(N)+1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))


N = list(input)
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
print(max(N))

N = list(input())
N.appnd('Z')
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))


N = list(input())
N.append(0)
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

N = list(input())
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

N = list(input())
dp = [0]*(len(N)+1)
for i in range(len(N)):
  if N[i] in'ACGT':
    dp[i] += 1
    dp[i+1] = dp[i]
  else:
    dp[i] = 0
print(max(dp))

Verdicts: Runtime Error

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()
max_acgt_len = 0

for i in range(len(s)):
    current_str = s[i:]

    for j in reversed(range(1, len(current_str))):
        print('searching: {}'.format(current_str[:j]))
        acgt_count = 0
        acgt_count += current_str[:j].count('A')
        acgt_count += current_str[:j].count('G')
        acgt_count += current_str[:j].count('C')
        acgt_count += current_str[:j].count('T')

        if acgt_count == len(current_str[:j]):
            max_acgt_len = max(max_acgt_len, acgt_count)

print(max_acgt_len)

s = input()
max_acgt_len = 0

for i in range(len(s)):
    current_str = s[i:]

    for j in reversed(range(1, len(current_str) + 1)):
        acgt_count = 0
        acgt_count += current_str[:j].count('A')
        acgt_count += current_str[:j].count('G')
        acgt_count += current_str[:j].count('C')
        acgt_count += current_str[:j].count('T')

        if acgt_count == len(current_str[:j]):
            max_acgt_len = max(max_acgt_len, acgt_count)
print(max_acgt_len)

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):
enki = {"A":"T", "C":"G", "G":"C", "T":"A"}
print(enki[str(input())])


S = input()
count = 0
ans = 0
for s in S:
    if s in "ACGT":
        count += 1
    else:
        if ans < count:
            ans = count
        count = 0
    if ans < count:
        ans = count
        
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):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] == 'A' or 'T' or 'C' or'G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in len(S):
    
    if S[i] in 'ATGC':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))


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):
str = input()
n = lent(str)
counter = []
max = 0
for i in range(n):
  counter[i] = 0

for i in range(n):
  if str[i] == "A" or "T" or "C" or "G":
    counter[i] ++
  
  
for i in range(n):
  if counter[i] > max:
    max = counter[i]
    
print(max)

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

con = 0;    
for i in range(n+1):
  if counter[i] == 1:
    con += 1
    continue
  else :
    if con > max :
      max = con
      con = 0
    
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()
cnt = 0
max_cnt = 0
for i in s:
    if i in ['A', 'T', 'C', 'G']:
        cnt += 1
    else:
        cnt = 0
    max_cnt = max(max_cnt, cnt)
print(cnt)

s = input()
cnt = 0
max_cnt = 0
for i in s:
    if i in ['A', 'T', 'C', 'G']:
        cnt += 1
    else:
        cnt = 0
    max_cnt = max(max_cnt, cnt)
print(max_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=input()
n=len(s)
at=["A","T","G","C"]
ans=[-1]
for i in range(n):
    if s[i] not in at:
        ans.append(i)#-ans[-1])
m=len(ans)
ans2=[]
for j in range(m-1):
    ans2.append(ans[j+1]-ans[j])
print(ans)    
print(max(ans2)-1)

s=input()
n=len(s)
at=["A","T","G","C"]
ans=[-1]
for i in range(n-1):
    if s[i] not in at:
        ans.append(i)#-ans[-1])
if s[n-1] in at:
    ans.append(n)
else:
    ans.append(n-1)

m=len(ans)
ans2=[]
for j in range(m-1):
    ans2.append(ans[j+1]-ans[j]-1)

#print(ans)
#print(ans2)

if len(ans)==1:
    print(n)
elif len(ans2)==0:
    print(0)
else:
    print(max(ans2))

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 = int(input())
l = list(map(int,input().split()))
l.sort(reverse = True)

if l[0] < sum(l[1:n]):
    print('Yes')
else:
    print('No')

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

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 re

s = input()
ans = max(
    len(m.group()) for m in re.findall('[AGCT]+', s),
    default=0
)

print(ans)


import re

s = input()
ans = max(
    len(m.group()) for m in re.findall('[AGCT]+'),
    default=0
)

print(ans)


import re

s = input()
ans = max(
    map(len, re.findall('[AGCT]+', s)),
    default=0
)

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted