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()
ans = 0
l = 0
for c in s:
  if c == 'A' || c == 'C' || c == 'G' || c == 'T':
    l += 1
  else:
    ans = max(ans, l)
    l = 0
ans = max(ans, l)
print(ans)


s = input()
ans = 0
l = 0
for c in s:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    l += 1
  else:
    ans = max(ans, l)
    l = 0
ans = max(ans, l)
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().strip()

flag = 0
ok_list = ['A', 'T', 'C', 'G']

max_len = 0
start, end, i = 0, 0, 0

while i < len(s):
    while s[i] not in ok_list:
        i += 1
    start = i

    while s[i] in ok_list:
        i += 1
    end = i

    tmp = s[start:end]
    if len(tmp) > max_len:
        max_len = len(tmp)


print(max_len)

s = input().strip()

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

max_len, i = 0, 0

while i < len(s):
    if s[i] in ok_list:
        l = 0
        while i < len(s) and s[i] in ok_list:
            i += 1
            l += 1

        if l > max_len:
            max_len = l

    else:
         i += 1

print(max_len)

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=''.join([i if i in ['A', 'C', 'G', 'T'] else ' ' for i in input()])
print(max(len, a.split())

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft

def main():
    s = input()
    ans = 0
    n = len(s)
    for i in range(n):
        for j in range(i+1, n+1):
            if len([k for k in s[i:j] if k not in 'ACGT']) == 0:
                ans = max(ans, j - i)
    print(ans)


main()


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
ans = 0
sets = {A,T,C,G}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

S = input()
cnt=0
ans = 0
sets = set([A,T,C,G])
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)


S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
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):
import re
S = input()
s = re.split('[ACGT]',S)
print(max(map(len,s)))

import re
S = input()
s = re.split('[BDEFHIJKLMNOPQRSUVWXYZ]',S)
print(max(map(len,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):

a = [str(i) for i in input()] 
max=0
ans=0

print(a)

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


a = [str(i) for i in input()] 
max=0
ans=0


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

if ans >= 11:
    ans=10
    
print(ans)


a = [str(i) for i in input()] 
max=0
ans=0


for i in range(len(a)):

    if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
        max=max+1
    else:
        if(ans <= max):
            ans=max
            max=0
        
        
if(ans <= max):
    ans=max

if ans >= 11:
    ans=10
    
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):
l = ('A', 'T', 'C', 'G')
S = input()

ans = [0]
for i in range(len(S)):
    if S[i] in l:
        res += 1
    elif res != 0:
        ans.append(res)
        res = 0

print(max(ans))

l = ('A', 'T', 'C', 'G')
S = input()

ans = [0]
res = 0
for i in range(len(S)):
    if S[i] in l:
        res += 1
    elif res != 0:
        ans.append(res)
        res = 0
ans.append(res)

print(max(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
    for x1 in range(len(s)):
        for x2 in range(x1+1, len(s)):
            for si in s[x1:x2]:
                if si not in ["A", "T", "G", "C"]:
                    break
            else:
                if count<x2-x1:
                    count = x2-x1
                    print(si, s[x1:x2])
    print(count)

if __name__=="__main__":
    main()



def main():
    s = input()
    max_length = 0
    cur_length = 0
    for i, si in enumerate(s):
        if si in ["A", "T", "G", "C"]:
            cur_length+=1
        else:
            if max_length<cur_length:
                max_length = cur_length
            cur_length = 0

    if max_length<cur_length:
        max_length = cur_length
    print(max_length)

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(map(str,input()))
for i in range(len(s)):
    s[i]='1' if (s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T') else '0'
len(max(''.join(s).split('0'),key=len))

s=list(map(str,input()))
for i in range(len(s)):
    s[i]='1' if (s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T') else '0'
print(len(max(''.join(s).split('0'),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):
S = input()
ans = [0] * (len(S) + 1)
for i in range(len(S)):
  if S[i] not in "ATCG": continue
  ans[i+1] += ans[i]
print(max(ans))

S = input()
ans = [0] * (len(S) + 1)
for i in range(len(S)):
  if S[i] not in "ATCG": continue
  ans[i+1] = ans[i] + 1
print(max(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()
count = 0
max = 0
ans = 0

for i in range(len(S)):
  if S[i] != "A" and S[i] != "C" and S[i] != "G" and S[i] != "T":
    max = count
    count = 0
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    count += 1
    
  print(i,count)
  if max > ans:
    ans = max
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: 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 = re.finditer(r'(A|T|G|C)+',s)
max=0
for a in ans:
    temp=len(a.group())
    if temp>=max:
        max=temp
print(max)

import re
s=input()
ans=re.findall(r"((A|T|G|C)+)",s)
print(ans)
if ans==[]:
    print(0)
else:
    print(ans)
    max=0
    for i in range(len(ans)):
        temp=ans[i][0]
        if len(temp) >= max:
            max=len(temp)
print(max)

s=list(input())
maximum=0
temp=0
k=0
for i in range(len(s)):
    sets=set(s[i])
    if sets.issubset(set("ATGC")):
        k=k+1
        if k>=maximum:
            maximum=k
    else:
        k=0
print(maximum)

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

S = list(input())
S.append('fuck')
lis = ['A','T','C','G']
count = 1 if S[0] in lis else 0
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 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()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count() == 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()
ans = 0
li = ["A", "C", "G", "T"]
count = 0
for i in s:
    if i in li:
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0
if count == len(ans):
    print(count)
else:
    print(ans)


s = input()
ans = 0
li = ["A", "C", "G", "T"]
count = 0
for i in s:
    if i in li:
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0

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

s = input()

ans = 0
for i in range(len(s)):
    for j in range(i,len(s)):
        tmp = s[i:j+1]
        if set(list(tmp)) <= set(["A","C","G","T"]):
            ans = max(ans,len(tmp))
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):
n = input()

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

n = input()

tmp = 0
count = 0
for i in n:
    if i == "A" or i == "C" or i == "G" or i == "T":
        count+=1
    else:
        tmp = max(tmp,count)
        count=0
print(max(tmp,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):
def main():
    s = input()
    max_len = 0
    length = 0

    s = list(s)
    s.append('')

    for i in s:
        if i in ['A', 'C', 'G', 'T']:
            length += 1
        else:
            if length > max_len:
                max_len = length
                length = 0


if __name__ == '__main__':
    main()


def main():
    s = input()
    max_len = 0
    length = 0

    for i in list(s).append(''):
        if i in ['A', 'C', 'G', 'T']:
            length += 1
        else:
            if length > max_len:
                max_len = length
                length = 0


if __name__ == '__main__':
    main()


def main():
    s = input()
    max_len = 0
    length = 0

    s = list(s)
    s.append('')

    for i in s:
        if i in ['A', 'C', 'G', 'T']:
            length += 1
        else:
            if length > max_len:
                max_len = length
                length = 0

    print(max_len)


if __name__ == '__main__':
    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()
i=1
ans=''
 
while i<=len(s):
  if s[i-1]=='A'|s[i-1]=='C'|s[i-1]=='G'|s[i-1]=='T':
    ans=ans+s[i-1]
  i+=1
 
print (len(ans))

s=input()
i=1
ans=''

while i<=len(s):
  if s[i-1]=='A'|s[i-1]=='C'|s[i-1]=='G'|s[i-1]=='T':
    i=i+ans
  i+=1

print (len(ans))  

s='AAABAAAAAA'
i=1
n=0
ans=[0]
sta=0
 
while i<=len(s):
  if s[i-1]=='A'or s[i-1]=='C' or s[i-1]=='G' or s[i-1]=='T':
    n=n+1
    sta=1
  elif sta==1:
    ans.append(n)
    n=0

  if i<=len(s):
    ans.append(n)
    
  i=i+1
  
print(max(ans))


s=input()
i=1
ans=''
sta=0
 
while i<=len(s):
  if s[i-1]=='A':
    ans=ans+s[i-1]
    sta=1
  elif s[i-1]=='T':
    ans=ans+s[i-1]
    sta=1
  elif s[i-1]=='C':
    ans=ans+s[i-1]
    sta=1
  elif s[i-1]=='G':
    ans=ans+s[i-1]
    sta=1
  elif sta==1:
    break
    
  i=i+1
print(ans)

i=1
n=0
ans=[]
sta=0
 
while i<=len(s):
  if s[i-1]=='A'or s[i-1]=='C' or s[i-1]=='G' or s[i-1]=='T':
    n=n+1
    sta=1
  elif sta==1:
    ans.append(n)
    n=0
    
  i=i+1
if sta==0:
  ans=[0]
  
print(max(ans))

s=input()
i=1
ans=''
 
while i<=len(s):
  if s[i-1]=='A'|s[i-1]=='C'|s[i-1]=='G'|s[i-1]=='T':
    ans=ans+s[i-1]
  i=i+1
 
print (len(ans))

s=input()
i=1
n=0
ans=[0]
sta=0

 
while i<=len(s):
  if s[i-1]=='A'or s[i-1]=='C' or s[i-1]=='G' or s[i-1]=='T':
    n=n+1
    sta=1
  elif sta==1:
    ans.append(n)
    n=0

  if i<=len(s)&n==len(s):
    ans.append(n)
  elif n!=0:
      ans.append(n)
    
  i=i+1
  
print(max(ans))


Verdicts: Runtime Error

Runtime Error

Wrong Answer

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

s=[i for i in input()]
l=[]
cnt=0
for i in range(len(s)):
  if s[i] in {"A","T","C","G"," "}:
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0    
print(sorted(l)[-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 = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-set(S) == set():
        count = max(count,j-i-1)
        
print(count)

S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)

s = list(input())

for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    s[i] = 1
  else:
    s[i] = 0
    
ans = []
for i in range(1,len(s)-2):
  for j in range(i,len(s)-1):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))

S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)):
    for j in range(i+1, len(S)+1):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)

Verdicts: 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 = input().strip()
enki = set('ATCG')
count = 0
maxlen = 0
for i in range(len(s)):
    if s[i] in enki:
        count += 1
    else:
        maxlen = max(maxlen, count)
        count = 0

return maxlen

s = input().strip()
enki = set('ATCG')
count = 0
maxlen = 0
for c in s:
    if c in enki:
        count += 1
    else:
        maxlen = max(maxlen, count)
        count = 0
maxlen = max(maxlen, count)
print(maxlen)

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())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
print(max(li2))
print(li2)

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

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;print(len(max(re.findall(r"[ACGT]+",input()),"",key=len)))

import re;print(max(map(len,re.split("[^ACGT]+",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()

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

S = input()

ns = [0]
n = 0

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

print(max(ns))

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):
checklist=["A","C","G","T"]
sn = list(input())

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    answer = max(answer,count)
    count = 0

print(answer)
print(sn)

checklist=['A','C','G','T']
sn = list(input())

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    count = 0
  answer = max(answer,count)

print(answer)

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

for i in range(10):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
    ans += 1
  else:
    if ans >= max:
      max = ans
    else:
      ans = 0

print(max)

S = input()
max = 0
ans = 0

for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
    ans += 1
    if ans > max:
      max = ans
  else:
    ans = 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):
import re

S=input()

ss = re.sub('[^A, T, C, G]', ',', S)
sss = ss.split(',')
ans = ""
for i in sss:
  if len(ans) < len(i):
    ans = i
print(ans)

import re

S=input()

ss = re.sub('[^A, T, C, G]', ',', S)
sss = ss.split(',')
ans = ""
for i in sss:
  if len(ans) < len(i):
    ans = i
print(len(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):
N = list(input())
print(N)
m = 0
cnt = 0
for x in N:
    
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        cnt += 1
    else:
        m = max(cnt, m)
        cnt = 0

m = max(cnt, m)

print(m)

N = list(input())
m = 0
cnt = 0
for x in N:
    
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        cnt += 1
    else:
        m = max(cnt, m)
        cnt = 0

m = max(cnt, m)

print(m)

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

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

    print(c)

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

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

#coding-utf-8

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

#   print(c)

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

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

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 k in range(len(s)):
    if S[k] == "A" or S[k] == "C" or S[k] == "G" or S[k] == "T":
        count += 1
        if count > count_max:
             count_max = count
    else:
        count=0
print(count_max)


S = input()
count = 0
count_max = 0

for k in range(len(S)):
    if S[k] == "A" or S[k] == "C" or S[k] == "G" or S[k] == "T":
        count += 1
        if count > count_max:
             count_max = count
    else:
        count=0
print(count_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()
s = {"A", "C", "G", "T"}
ans = 0
for i in S:
  if i in s:
    tmp += 1
    ans = max(ans, tmp)
  else:
    tmp = 0
print(ans)

S = input()
s = {"A", "C", "G", "T"}
ans = 0
tmp = 0
for i in S:
  if i in s:
    tmp += 1
    ans = max(ans, tmp)
  else:
    tmp = 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 = list(input())
n = len(S)
m = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        print(S[i:j], j - i)
        if j - i > m and all(s in "ACGT" for s in S[i:j]):
            m = j - i
print(m)

S = list(input())
n = len(S)
m = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        if j - i > m and all(s in "ACGT" for s in S[i:j]):
            m = j - i
print(m)

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()
m=0
count=0
for s in S:
    if(s=="A" OR s=="C" OR s=="G" or s=="T"):count+=1
    else:count=0
    m=max(m,count)
print(m)

S=input()
m=0
count=0
for s in S:
    if(s=="A" OR s=="C" OR s=="G" OR s=="T"):count+=1
    else:count=0
    m=max(m,count)
print(m)

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


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):
import re

# str = input()

str = "HATAGAYA"

pattern = r"[ATCG]+"

matched_list = re.findall(pattern, str)

maxlength = 0
for item in matched_list:
    tmplength = len(item)
    if maxlength < tmplength:
        maxlength = tmplength

print(maxlength)

import re

str = input()


pattern = r"[ATCG]+"

matched_list = re.findall(pattern, str)

maxlength = 0
for item in matched_list:
    tmplength = len(item)
    if maxlength < tmplength:
        maxlength = tmplength

print(maxlength)


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

count=0
seq=["A","T","G","C"]
for base in seq:
    if base in ref:
        count +=1
    else:
         count =0

print(count)

ref=input()

count=0
seq=["A","T","G,","C"]
for base in ref:
    if base in ref:
        count +=1
    else count =0

print(count)

ref=input()

count=0
seq=["A","T","G,","C"]
for base in seq:
    if base in ref:
        count +=1
    else:
         count =0

print(count)


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

Verdicts: 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):
# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
print(S)
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0
if lenth==len(S):
    max=lenth
    
print(max)


# Coding-utf

S=list(map(str, input()))
lenth=0
max=0
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            lenth+=1
    else:
        if max<lenth:
            max=lenth
            lenth=0
        else:
            lenth=0

if max<lenth:
    max=lenth

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()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
        count = 0
else:
    num.append(count)
print(max(num))
 
  

s = input()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
print(max(num))
 

s = input()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
print(max(num))
 

s = input()
num = []
lists = ["A","C","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
        count = 0
else:
    num.append(count)
print(max(num))
 

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

cnt = 0
max_cnt = 0

for i in S:
  if i == "A" or "C" or "G" or "T":
    cnt +=1
    if cnt > max_cnt:
      max_cnt = cnt
  else:
    cnt = 0
    
print(max_cnt)
    

S = input()

cnt = 0
max_cnt = 0

for i in S:
  if i in "ACGT":
    cnt += 1
    if cnt > max_cnt:
      max_cnt = cnt
  else:
    cnt = 0
    
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()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(I):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
print(max(ans))


s=input()
ans=[]
I=[0]*len(s)
for i in range(len(s)):
    if (s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C"):
        I[i]=1

    else:
        I[i]=0
for i in range(len(I)):
    if (I[i]==1 and I[i-1]==0) or (I[i]==1 and i==0):
        ans.append(1)
    elif (I[i]==1 and I[i-1]==1):
        ans[-1]+=1
if ans==[]:
    print(0)
else:
    print(max(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()
ans=0
for i in range(len(s)):
  l=0
  for j in range(i:len(s)):
    if s[j] in ["A","T","G","C"]:
      l+=1
    else:
      break
  ans=max(ans,l)
print(ans)

s=input()
ans=0
for i in range(len(s)):
  l=0
  for j in range(i,len(s)):
    if s[j] in ["A","T","G","C"]:
      l+=1
    else:
      break
  ans=max(ans,l)
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 re
print(max(map(len, re.split('[ACGT]',input()))))

s = list(input())

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

print(max(cnt))


S = input()

cnt = 0
mcnt = 0
for i in S:
    print(i)
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        cnt += 1
        mcnt = max(mcnt,cnt)

print(mcnt)


S = input()

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

print(mcnt)


Verdicts: 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):
code = input()
read_code = list(code)
count = 0
count_end = 0

for i in range(0, len(read_code)):
    code_count = False
    if read_code[i] == "A" or read_code[i] == "C" or read_code[i] == "G" or read_code[i] == "T":
        code_count = True
    else:
        code_count = False
        count_end = count
        count = 0

    if(code_count == True):
        count += 1

print(count_end)


code = input()
read_code = list(code)
count = 0
count_end = 0

for i in range(0, len(read_code)):
    code_count = False
    if read_code[i] == "A" or read_code[i] == "C" or read_code[i] == "G" or read_code[i] == "T":
        code_count = True
    else:
        code_count = False
        count_end = count
        count = 0

    if(code_count == True):
        count += 1

print(count_end)


code = input()
read_code = list(code)
count = 0
count_end = 0

for i in range(0, len(read_code)):
    code_count = False
    if read_code[i] == "A" or read_code[i] == "C" or read_code[i] == "G" or read_code[i] == "T":
        count += 1
        if(count >= count_end):
            count_end = count
    else:
        count = 0

print(count_end)


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


s=list(input())
#print(s)
#print(len(s))
Ans =[0]
ans = 0
for i in range(len(s)):
    if s[i]=='A'or s[i]=='T'or s[i]=='G'or s[i]=='C':
        ans += 1
    else:
        Ans.append(ans)
        ans = 0
Ans.append(ans)
#print(Ans)
print(max(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 = ["A","C","G","T"]
S_tf = [any([sss == aaa for aaa in acgt]) for sss in S]
print(S_tf)
maxlen = 0
curlen = 0
for i in S_tf:
    if i:
        curlen += 1
        if maxlen < curlen:
            maxlen = curlen
    else:
        curlen = 0
print(maxlen)

S = input()
acgt = ["A","C","G","T"]
S_tf = [any([sss == aaa for aaa in acgt]) for sss in S]
maxlen = 0
curlen = 0
for i in S_tf:
    if i:
        curlen += 1
        if maxlen < curlen:
            maxlen = curlen
    else:
        curlen = 0
print(maxlen)

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

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

S = list(input())
answer = 0

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

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=1
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] in {'A','T','C','G',' '}:
        if i==n-1:
            ans+=1
        elif s[i+1] in {'A','T','C','G',' '}:
            ans+=1
    else:
        ans_list.append(ans)
        ans=1

print(ans_list)
if max(ans_list)==1:
    print(0)
else:
    print(max(ans_list))

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

for i in range(0,n):
    if s[i] in {'A','T','C','G',''}:
        if s[i+1] in {'A','T','C','G',''}:
            ans+=1

print(ans)

s=input()
ans=0
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] not in {'A','T','C','G',' '}:
        ans_list.append(ans)
        ans=0
#        print(str(ans)+'!')
    else:
        ans+=1
        if i == n-1:
           ans_list.append(ans) 
 #       print(str(ans)+'z')

#print(ans_list)
if max(ans_list)==0:
    print(0)
else:
    print(max(ans_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):
import re
s = input()
m = re.findall(r"([ACGT]+)", s)
print(max(m, key=len) if m else 0)


import re
s = input()
m = re.findall(r"([ACGT]+)", s)
print(len(max(m, key=len)) if m else 0)


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
result = 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
  if result < count:
      result = count
      count =0

if result < count:
  result = count

print(result)


s = input()

count = 0
result = 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
  if result < count:
      result = count
      count =0

if count > 0:
  result = count

print(result)


s = input()

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

if result < count:
  result = count

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()
l=len(S)
ans=0
str='ACGT'
for i in range(l):
    for j in range(i,l):
        for k in range(i,j+1):
            if str.count(S[k])==1:
                ans=max(ans,j-i+1)
print(ans)

S=input()
l=len(S)
ans=0
str='ACGT'
for i in range(l):
    for j in range(i,l):
        if all (str.count(x)==1 for x 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):
import re

split = re.split('[^ACGT]', input())
print(split)
print(max(map(len, split)))


import re

split = re.split('[^ACGT]', input())

print(max(map(len, split)))


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):
list_original=input()
box=list(list_original)
MAX = 0
count = 0
flag = 0
for figure in box:
  if figure == 'A' or figure =='G' or figure =='C' or figure == 'G':
    flag = 1
  else:
    flag = 0
    count = 0
  if flag == 1:
    count += 1
  if count > MAX:
    MAX =count
print(MAX)

list_original=input()
box=list(list_original)
MAX = 0
count = 0
flag = 0
for figure in box:
  if figure == 'A' or figure =='T' or figure =='C' or figure == 'G':
    flag = 1
  else:
    flag = 0
    count = 0
  if flag == 1:
    count += 1
  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 = str(input())

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

count = 0
count_list = []
count_list.append(0)
list_S = list(S)

for i in range(0, len(list_S)):
  if list_S[i] in acgt_list:
    for j in range(i, len(list_S)):
      if list_S[j] in acgt_list:
        count += 1
      else:
        count_list.append(count)
        count = 0
        break
  else:
    continue
print(count_list)

# -*- coding: utf-8 -*-
S = str(input())

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

count = 0
count_list = []
count_list.append(0)
list_S = list(S)
length = len(list_S)

for i in range(0, length):
  if list_S[i] in acgt_list:
    for j in range(i, length):
      if list_S[j] in acgt_list:
        count += 1
      else:
        count_list.append(count)
        count = 0
        break
      if j == length -1:
        count_list.append(count)
        count = 0
print(max(count_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()
z = ''
ans = ''
for i in range(len(s)):
  if s[i] in 'ACGT':
    z = s[i]
	for j in range(i+1, len(s)):
      if s[j] in 'ACGT':
        z += s[j]
      else:
        if len(s) > len(ans):
          ans = s
        z = ''
  else:
    continue
print(ans)

s = input()
z = ''
ans = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        ans = 1
        for j in range(i+1, len(s)):
            if s[j] in 'ACGT':
                ans = max(ans, j-i+1)
            else:
                break
    else:
        continue
print(ans)

s = input()
z = ''
ans = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        ans = max(ans, 1)
        for j in range(i+1, len(s)):
            if s[j] in 'ACGT':
                ans = max(ans, j-i+1)
            else:
                break
    else:
        continue
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()
def c(b):
  return b=='A' or b=='G' or b=='T' or b=='C'

suc=[]
ct=0
for let in s:
  if c(let):
    ct+=1
  else:
    suc.append(ct)
    suc=0
suc.append(ct)
print(max(suc))

s=input()
def c(b):
  return b=='A' or b=='G' or b=='T' or b=='C'

suc=[]
ct=0
for let in s:
  if c(let):
    ct+=1
  else:
    suc.append(ct)
    ct=0
suc.append(ct)
print(max(suc))

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()
ans = 0
lis = []

for a in s:
  if a == "A" or a == "T" or a == "C" or a == "G":
    ans += 1
  else:
    lis.append(ans)
    ans = 0

print(lis)
 

s = input()
ans1 = 0
ans2 = 0

for a in s:
  if a == "A" or a == "T" or a == "C" or a == "G":
    ans2 += 1
  else:
    if ans1 < ans2:
      ans1 = ans2
      ans2 = 0
    else:
      ans2 = 0
print(max(ans1, ans2))

Verdicts: Wrong Answer

Accepted