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

ans=0
'''
for i in range(N):
    if S[i] in "ACGT":
        ans=1

for l in range(N-1):
    for r in range(l+1,N):
        for s in S[l:r]:
            if not s in "ACGT":
                break
        else:
            ans=max(ans,len(S[l:r])) 
'''

for i in range(N):
    for j in range(i,N):
        if all("ACGT".count(c)==1 if 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):
    if S[i] in "ACGT":
        ans=1

for l in range(N-1):
    for r in range(l+1,N):
        for s in S[l:r]:
            if not s in "ACGT":
                break
        else:
            ans=max(ans,len(S[l:r])) 
'''

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

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


print(m)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

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

tmp=0
length=[]

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

s=input()

tmp=0
length=[]

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

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()
S = list(S)
cnt = 0
maxcount = 0
print(S)

for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        cnt += 1
        if cnt > maxcount:
            maxcount = cnt
    else:
        cnt = 0
print(maxcount)

S = input()
S = list(S)
cnt = 0
maxcount = 0

for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        cnt += 1
        if cnt > maxcount:
            maxcount = cnt
    else:
        cnt = 0
print(maxcount)

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 = input()
count = 0
mx = 0
for i in range(len(a)):
	if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
      count += 1
    else:
      count = 0
    if ma < count:
      mx = count
print(mx)

a = input()
count = 0
mx = 0
for i in range(len(a)):
    if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
        count += 1
    else:
        count = 0
    if mx < count:
        mx = count
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 sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' | tmp=='T' | tmp=='C' | tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)

import sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' or tmp=='T' or tmp=='C' or tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

warehouse.append(scavenger)

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)

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(0,len(S)):
  tmp = S[i]
  if(tmp == "A" or tmp == "G" or tmp == "C" or tmp == "T"):
    ans += 1
  else:
    ans = 0
print(str(ans))

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

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)
for i in range(n):
    for j in range(i,n):
        if all("ATGC".count(c) == 1 for c in s[i:j+1]):
            ans = max(ans,j - i + 1)
print(ans)

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

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

import sys
import math
import numpy as np
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    def f(s):
        if s == "":return 0
        t = s.replace("A","").replace("T","").replace("G","").replace("C","")
        if t == "":return len(s)
        else:return 0
    s = S()
    n = len(s)
    ans = 0
    cnt = 0
    for i in range(n):
        for j in range(i,n):
            t = s[i:j+1]
            ans = max(f(t),ans)
    print(ans)

Verdicts: 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=list(input())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
for i in ans:
    if list(set(i)) == d:
        x.append(len(i))
    else:
        pass
print(max(x))

s=list(input())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
print(ans)
for i in ans:
    if set(i) <= set(d):
        x.append(len(i))
    else:
        pass
if x:
  print(max(x))
else:
  print(0)

s=list(input())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
for i in ans:
    if set(i) <= set(d):
        x.append(len(i))
    else:
        pass
if x:
  print(max(x))
else:
  print(0)

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()
# print(S)
# print(len(S))
list = []
for i in range(len(S)):
    if(S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T"):
        list.append(i)
# print(list)
NUM = []
for j in range(len(list)):
    num = 1
    for k in range(len(list) - j - 1):
        # print("k",k)
        if(list[k+1] - list[k] == 1):
            num += 1
            # print("k1:",k)
        else:
            NUM.append(num)
# print(NUM)
if(len(NUM) == 0):
    print(0)
else:
    print(max(NUM))


S = input()
# print(S)
# print(len(S))
list = []
for i in range(len(S)):
    if(S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T"):
        list.append(i)
# print(list)
NUM = []
for j in range(len(list)):
    num = 1
    for k in range(j,len(list)-1):
        # print("k:",k)
        # print("list[j+1]:",list[j+1], "list[j]:", list[j])
        # print("list[k+1]:",list[k+1], "list[k]:", list[k])
        if(list[k+1] - list[k] == 1):
        # if(list[j+1] - list[j] == 1):
            num += 1
            # print("k1:",k)
        else:
            NUM.append(num)
            # print("NUM1:", NUM)
            break
    else:
        NUM.append(num)
        # print("NUM2:", NUM)

# print("NUM3:",NUM)
if(len(NUM) == 0):
    print(0)
else:
    print(max(NUM))



Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
b = input()
c = b
n, m = 0, 0
for i in "ACGT":
    c = c.replace(i, "")
for j in c:
    n = max([len(k) for k in b.split(j)])
    if n > m:
        m = n
if c == "":
    print(len(b))
else:
    print(m)


b = input()
c = b
n, m = 0, 0
for i in "ACGT":
    c += c.replace(i, "")
for i in c:
    n = max([len(i) for i in b.split(c)])
    if n > m:
        m = n
print(m)


b = input()
m, c = 0, 0
for i in b:
    if i in "ACGT":
        c += 1
        if c > m:
            m = c
    else:
        c = 0
print(m)


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):
ACGT = ['A', 'C', 'G', 'T']


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

    return True


def main():
    S = input()

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

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


if __name__ == "__main__":
    main()


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


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

    return True


def main():
    S = input()

    results = []
    # all_results = []
    for i in range(len(S)):
        for j in range(len(S)):
            if not_acgt(S[i:j+1]):
                results.append(S[i:j+1])
            # all_results.append(S[i:j+1])
    try:
        print(max([len(s) for s in results]))
    except Exception:
        print(0)


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):
#!/usr/bin/python

import re

def main():
    s = str(input())
    print(max([x for x in (re.split('[^ACGT]+', s))]))


if __name__ == "__main__":
    main()

#!/usr/bin/python

import re

def main():
    print(max([len(x) for x in re.findall(r'[ACGT]*', str(input()))]))

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()
l = re.findall(r'[ACGT]+', S)
if l:
  print(max(map(len, l)))
else:
  print(0)


import re

S = input()
l = re.findall(r'[ACGT]+', S)
print(max(map(len, l), default=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()
count = 0

for i in range(S):
  if i == "A" or i == "C" or i == "G" or i == "T":
    count += 1
print("%d"%(count))    
  


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

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

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

s=list(map(str,input().split()))
a=0
for i in s:
  if i in ATGC:
    a+=1
  else:
    b=a
    a=0
print(max(a,b))

s=input()
a=0
for i in s:
  if i in "ATGC" :
    a+=1
  else:
    b=a
    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

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()
S_list = list(S)
S_ex = ''.join((['1' if (k == 'A' or k == 'C' or k == 'G' or k == 'T') else '0' for k in S_list]))
S_ans = [len(k) for k in S_ex.split('0')]
max(S_ans)

S = input()
S_list = list(S)
S_ex = ''.join((['1' if (k == 'A' or k == 'C' or k == 'G' or k == 'T') else '0' for k in S_list]))
S_ans = [len(k) for k in S_ex.split('0')]
print(max(S_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 = 0
count = 0

for s in S:
    if s in ["A", "C", "G", "T"]:
        count += 1
        ans = max(max_count, count)
    else:
        count = 0

print(ans)


S = input()
ans = 0
count = 0

for s in S:
    if s in ["A", "C", "G", "T"]:
        count += 1
        ans = max(ans, count)
    else:
        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):
string_list = list(input())
string_len = len(string_list)
renzoku_list = []

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

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

string_list = list(input())
string_len = len(string_list)
renzoku_list = []

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

find_letter()
  
if renzoku_list:
  max_len = max(renzoku_list)
  print(max_len)
else:
  print(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()
L=len(S)
longest=0
for i in range(L):
  for j in range(i):
    DUP=S[j:i+1]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count+1)
print(longest)

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


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()
c=0
m=0
acgt=['A','C','G','T']
for e in s:
  if e in acgt:
    print(e)
    c+=1
  else:
    if c > m:
      m=c
    c=0
print(m)

s=input()
c=0
m=0
for e in s:
  if e in "ACGT":
    c+=1
  else:
    if c>m:
      m=c
    c=0
if c>m:
  m=c
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):
import re

S = input()
ans = re.split(r'[^ATGC]', S)

maxlen = -1
maxarg = 0
for i,a in enumerate(ans):
    if len(a) > maxlen:
        maxlen = len(a)
        maxarg = i
print(ans[maxarg])



import re

S = input()
ans = re.split(r'[^ATGC]', S)

maxlen = -1
maxarg = 0
for a in ans:
    maxlen = len(a) if len(a) > maxlen else maxlen

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

  


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):
import io, sys, atexit, os

import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


def li ():
	return list (map (int, input ().split ()))


def num ():
	return map (int, input ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


mm = 1000000007



def solve ():
	t = 1
	for it in range (t):
		s=input()
		if("ACGT" in s):
			print(4)
			continue
		if("ACG" in s):
			print(3)
			continue
		if("AC" in s):
			print(2)
			continue
		if("A" in s):
			print(1)
			continue
		print(0)
			





if __name__ == "__main__":
	solve ()

import io, sys, atexit, os

import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


def li ():
	return list (map (int, input ().split ()))


def num ():
	return map (int, input ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


mm = 1000000007



def solve ():
	t = 1
	for it in range (t):
		s=input()
		xp="ACGT"
		mx=0
		for i in range(len(s)):
			if(s[i] in xp):
				cc=0
				for j in range(i,len(s)):
					if(s[j] in xp):
						cc+=1
					else:
						break
				mx=max(mx,cc)
		print(mx)






if __name__ == "__main__":
	solve ()

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()
T = set()
for i in range(len(S)):
  for j in range(len(S)):
    T.add(S[i:i+j])
from itertools import product
check = []
for i in range(11):
  for per in product(["A","C","G","T"], repeat = i):
    per = "".join(per)
    check.append(per)
check = list(set(check))

ans = 0
for t in T:
  tt = "".join(t)
  if(tt in check):
    ans = max(ans, len(tt))
print(ans)

import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def check(In):
    return In != "A" and In != "C" and In != "G" and In != "T"

def main():
    s = ns()

    count = 0
    ans = 0
    for i in range(len(s)):
        if check(s[i]):
            count = 0
        else:
            count += 1
            ans = max(ans, count)
    print(ans)

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()
lis_S = list(S)
Ans = 0
for char in lis_S:
    if char=="A" or char=="C" or char=="G" or char=="T":
        Ans += 1
    elif index < len(lis_S):
        continue
    else:
        break
print(Ans)

S = input()
lis_S = list(S)
Ans = []
index = 0
n = 0
for char in lis_S:
    Ans.append(0)
    if char=="A" or char=="C" or char=="G" or char=="T":
        Ans[n] += 1
        index += 1
    elif index < len(lis_S):
        index += 1
        n += 1
        continue
    else:
        break
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, cnt = 0
for c in s:
  if c in ['A', 'C', 'T', 'G']:
    cnt += 1
    if cnt > ans:
      ans = cnt
  else:
    cnt = 0
print(ans)

s = input()
ans = 0
cnt = 0
for c in s:
  if c in ['A', 'C', 'T', 'G']:
    cnt += 1
    if cnt > ans:
      ans = cnt
  else:
    cnt = 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):
import string
str_up = string.ascii_uppercase.replace("A","").replace("C","").replace("G","").replace("T","")
S = input()
part = []
for i in range(len(S)):
    for j in range(len(S)-i+1):
        part.append(S[i:i+j])
max_s = 0
print(part)
for i in part:
    for j in str_up:
        if j in i:
            break
        elif j == "Z":
            if len(i) > max_s:
                max_s = len(i)
print(max_s)


import string
str_up = string.ascii_uppercase.replace("A","").replace("C","").replace("G","").replace("T","")
S = input()
part = []
for i in range(len(S)):
    for j in range(len(S)-i+1):
        part.append(S[i:i+j])
max_s = 0
print(part)
for i in part:
    for j in str_up:
        if j in i:
            break
        elif j == "Z":
            if len(i) > max_s:
                max_s = len(i)
print(max_s)


import string
str_up = string.ascii_uppercase.replace("A","").replace("C","").replace("G","").replace("T","")
S = input()
part = []
for i in range(len(S)):
    for j in range(len(S)-i+1):
        part.append(S[i:i+j])
max_s = 0

for i in part:
    for j in str_up:
        if j in i:
            break
        elif j == "Z":
            if len(i) > max_s:
                max_s = len(i)
print(max_s)

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

s.append("X")
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)


s = input()

s += "X"
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

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):
s=input()
n=len(i)
 
res=0
for i in range(n):
  for j in range(i,n):
    sub=s[i:j+1]
    flg=True
    for k in sub:
      if(k not in ['A','G','C','T']):
        flg=False
    if(flg):
      res=max(res,len(sub))
      
print(res)

i=input()
n=len(i)

res=0
for i in range(n):
  for j in range(i,n):
    sub=s[i:j+1]
    flg=True
    for k in sub:
      if(k not in ['A','G','C','T']):
        flg=False
    if(flg):
      res=max(res,len(sub))
      
print(res)

s=input()
n=len(s)
 
res=0
for i in range(n):
  for j in range(i,n):
    sub=s[i:j+1]
    flg=True
    for k in sub:
      if(k not in ['A','G','C','T']):
        flg=False
    if(flg):
      res=max(res,len(sub))
      
print(res)

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):
ACGT = ['A', 'C', 'G', 'T']
S = input()
cnt = 0
max_cnt = 0
for s in S:
    if s in ACGT:
        cnt += 1
        cntList.append(cnt)
    else:
        max_cnt = max(cnt, max_cnt)
        cnt = 0
print(max_cnt)

S = input()
 
ACGT = ['A', 'C', 'G', 'T']
cntList = []
cnt = 0
cntList.append(cnt)
for s in S:
    if s in ACGT:
        cnt += 1
        cntList.append(cnt)
    else:
        cnt = 0
print(max(cntList))

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)
tmp = ['']
x = {'A', 'C', 'G', 'T'}
for i in range(N):
    for j in range(i, N):
        if set(S[i:j+1]) <= x:
            tmp.append(S[i:j+1])
print(max(tmp, key=len))


S = input()
N = len(S)
tmp = ['']
x = {'A', 'C', 'G', 'T'}
for i in range(N):
    for j in range(i, N):
        if set(S[i:j+1]) <= x:
            tmp.append(S[i:j+1])
print(max(map(len, tmp)))


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):
string = input()
ch = string[0]
max_string_len = 0
prev_len = 0
for idx,ch in enumerate(string):
  if ch  in {"A","T","G","C"}:
    prev_len += 1
  	max_string_len = max(max_string_len,prev_len)
  else:
    prev_len = 0
    
print(max_string_len)

string = input()
ch = string[0]
max_string_len = 0
prev_len = 0
for idx,ch in enumerate(string):
  if ch  in {"A","T","G","C"}:
    prev_len += 1
    max_string_len = max(max_string_len,prev_len)
  else:
    prev_len = 0
    
print(max_string_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):
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if all(c in 'ATCG' for c in s[i:j]):
            ans += 1

print(ans)


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

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
S = input()
maxlength = 0
length = 0
for i in S:
  if i in 'ATGC':
    length += 1
  else:
    length =0
  maxlength = max(maxlength, length)

S = input()
maxlength = 0
length = 0
for i in S:
  if i in 'ATGC':
    length += 1
  else:
    length =0
  maxlength = max(maxlength, length)
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):
tmp = input()

out_1 = 0
for c in tmp:
        tmp_s = []
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        elif out_1 < len(tmp_s):
                out_1 = len(tmp_s)
                tmp_s = []
print(out_1)

tmp = input()

out_1 = 0
for c in tmp:
        tmp_s = []
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        elif out_1 < len(tmp_s):
                out_1 = len(tmp_s)

print(out_1)

tmp = input()

out_1 = 0
tmp_s = []
for c in tmp:
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        else:
                if out_1 < len(tmp_s):
                        out_1 = len(tmp_s)
                tmp_s = []
if out_1 < len(tmp_s):
        out_1 = len(tmp_s)
print(out_1)

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())
F = ["A", "C", "G", "T"]
count = 0
max = 0
f = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        f = max
        max = 0
print(max if max > f else f)

S = list(input())
F = ["A", "C", "G", "T"]
count = 0
max = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        f = max
        max = 0
print(max if max > f else f)

S = list(input())
F = ["A", "C", "G", "T"]
count = 0
max = 0
f = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        if max != 0:
            f = max
        max = 0
    
print(max if max > f else f)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

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

L = [0]
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        
max(L)

s = input()

L = []
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        
max(L)

s = list(input())

L = []
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        cnt = 0
L.append(cnt)

print(max(L))

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()
slist=[]
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        slist.append(S[i:j])
ma=0
for s in slist:
    flag = True
    for w in s:
        if w not in ['A','C','G','T']:
            flag = False
    if flag:
        print(s)
        ma = max(ma, len(s))
print(ma)

S=input()
slist=[S]
for i in range(len(S)):
    for j in range(i+1, len(S)):
        slist.append(S[i:j])
ma=0
for s in slist:
    flag = True
    for w in s:
        if w not in ['A','C','G','T']:
            flag = False
    if flag:
        print(s)
        ma = max(ma, len(s))
print(ma)

S=input()
slist=[]
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        slist.append(S[i:j])
ma=0
for s in slist:
    flag = True
    for w in s:
        if w not in ['A','C','G','T']:
            flag = False
    if flag:
        ma = max(ma, len(s))
print(ma)

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):
def checkACGT(s):
    for i in range(len(s)):
        if s[i] == "A" or s[i] == "G" or s[i] == "C" or s[i] == "T":
            continue
        else:
            return False
    return True

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

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

def checkACGT(s):
    for i in range(len(s)):
        if s[i] == "A" or s[i] == "G" or s[i] == "C" or s[i] == "T":
            continue
        else:
            return False
    return True

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

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()
set = {'A', 'T', 'G', 'C'}
l, ans = 0, 0
for i in len(s):
  if s[i] in set:
    l += 1
  else:
    ans = max(l, ans)
    l = 0
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
s = input()
n = len(s)
l = list("ACGT")
A = 0
for i in range(n):
  for j in range(i+1,n+1):
    x = s[i,j]
    if all(k in l for k in x):
      A = max(A,len(x))
print(A)

s = input()
n = len(s)
l = list("ACGT")
A = 0
for i in range(n):
  for j in range(i+1,n+1):
    x = s[i:j]
    if all(k in l for k in x):
      A = max(A,len(x))
print(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):
S = input()
gene = ['A','T','C','G']

length = len(S)
ans = 0
tmp = 0

for i in range(length):
  if s[i] in gene:
    tmp += 1
  else:
    tmp = 0
  if tmp >= ans:
    ans = tmp
print(ans)
      

S = input()
gene = ['A','T','C','G']

length = len(S)
ans = 0
tmp = 0

for i in range(length):
  if S[i] in gene:
    tmp += 1
  else:
    tmp = 0
  if tmp >= ans:
    ans = tmp
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S.  Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.

Submission attempts (in order):
cnt = 0
rslt = 0


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


print(rslt)
    
            




from sys import stdin

str = stdin.readline().rstrip()


cnt = 0
rslt = 0




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


print(rslt)
    
            



cnt = 0
rslt = 0
for a in "HATAGAYA":
    for b in "ATGC":
        if a == b:
            cnt = cnt + 1
            break
        elif b == "C":
            cnt = 0
    
    if rslt <= cnt:
        rslt = cnt


print(rslt)

from sys import stdin

str = stdin.readline().rstrip()


cnt = 0
rslt = 0




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


print(rslt)
    
            



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):
s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(s-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)

s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(s-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag:
			ans+=1
			break
print(ans)

s=input()
ans=0
for length in range(1,len(s)+1):
	for left in range(s-length+1):
		z=s[left:left+length]
		flag=True
		for i in range (length):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag:
			ans+=1
			break
print(ans)
				
				
				
		
		
	


s=input()
ans=0
for x in range(1,len(s)+1):
	for left in range(len(s)-x+1):
		z=s[left:left+x]
		flag=True
		for i in range(x):
			if z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":
				flag=False
				break
		if flag==True:
			ans+=1
			break
print(ans)

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

text = ""
ans = 0
for idx, moji in enumerate(S):
    
    if moji == "A" or moji == "C" or moji == "G" or moji == "T":
        text += moji
        for j in range(idx+1,len(S)):
            if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
                text += S[j]
            else:
                if "T" in text and len(text) > ans:
                    print(text)
                    ans = len(text)
                text = ""
                break
    else:
        text = ""

print(ans)

S = input()

text = ""
ans = 0
for idx, moji in enumerate(S):
    
    if moji == "A" or moji == "C" or moji == "G" or moji == "T":
        text += moji
        for j in range(idx+1,len(S)):
            if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
                text += S[j]
                #print(0, text)
            else:
                #print(-1, text)
                if len(text) > ans:
                    ans = len(text)
                text = ""
                break
        if len(text) > ans:
            ans = len(text)
        text = ""
    else:
        text = ""

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

s=str(input())
ans=0
cnt=0

for i in range(len(s)):
  
  if s[i]=="A" or s[i]== "G" or s[i]== "C" or s[i]== "T":
    cnt=cnt+1
    ans=max(ans, cnt)
    
  else:
    cnt=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):
if __name__ == '__main__':
  l = input().split()
  counter = 0
  max = 0
  for s in l:
    if s == 'A' or s == 'G' or s == 'C' or s == 'T':
      counter += 1
      if max <= counter:
        max = counter
    else:
      counter = 0
  print(max)

if __name__ == '__main__':
  str = input()
  l = list(str)
  counter = 0
  max = 0
  for s in l:
    if s == 'A' or s == 'G' or s == 'C' or s == 'T':
      counter += 1
      if max <= counter:
        max = counter
    else:
      counter = 0
  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()

x = ["A","c","G","T"]

ans = 0
cnt = 0

for i in s:
    if i not in x:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
        
print(ans)

s = input()

x = ["A","c","G","T"]

ans = 0
cnt = 0

for i in s:
    if i not in x:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0

s = input()

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

ans = 0
cnt = 0

for i in range(len(s)):
    if s[i] not in x:
        ans = max(ans,cnt)
        if i != (len(s)-1):
            cnt = 0
    else:
        cnt += 1
            
ans = max(ans,cnt)
        
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 = list(input())
N = len(S)
for i in range(N):
    if S[i] is not 'A' or 'T' or 'G' or 'C':
        S.remove(S[i])
print(len(S))

S = list(input())
N = len(S)
H = list('ATGC')
m = 0
ans = 0
for i in range(N):
    if S[i] in H:
        m += 1
        if ans < m:
            ans = m
    else:
        m = 0
print(ans)

Verdicts: Runtime Error

Accepted