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()
2 N = len(S)
3 ans = 0
4 for i in range(N):
5 for j in range(i, N):
6 if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
7 ans = max(ans, j - i + 1)
8 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 = list(input())
ACGT_filter = ['A', 'C', 'G', 'T']

str_length = 0
str_lengths = []
for s in S:
    if s in ACGT_filter:
        print(s)
        str_length += 1
    else:
        str_lengths.append(str_length)
        str_length = 0

print(max(str_lengths))

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

ans = 0
now = 0
for s in input():
    if s in ACGT_filter:
        now += 1
    else:
        now = 0
    ans = max(now, 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):
#ABC122B
S = input()
SC= S.replace('C','A')
SCG = SC.replace('G','A')
SCGT = SCG.replace('T','A')
ans = 0
wk = 0
print(SCGT)
for i in range(int(len(S))):
    if SCGT[i:i+1] == 'A':
        wk += 1
    else:
        if wk >= ans:
            ans = wk
        wk =0
        
print(ans)

#ABC122B
S = input()
SC= S.replace('C','A')
SCG = SC.replace('G','A')
SCGT = SCG.replace('T','A')
ans = 0
wk = 0
for i in range(int(len(S))):
    if SCGT[i:i+1] == 'A':
        wk += 1
    else:
        if wk >= ans:
            ans = wk
        wk =0

if wk >= ans:
    ans = wk
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 sys
input = sys.stdin.readline 

s = input().replace("\n","")

ans = 0

for i in range(len(s)):
    cnt = 0
    for j in range(i,len(s)):
        print(len(s),i)
        print(s[j:])
        print(s[j])
        if s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T':
            cnt += 1
            if cnt > ans:
                ans = cnt
        else:
            print("AGCT意外です。カウント数：",cnt)
            break

print(ans)

import sys
input = sys.stdin.readline 

s = input().replace("\n","")

ans = 0

for i in range(len(s)):
    cnt = 0
    for j in range(i,len(s)):
        # print(len(s),i)
        
        # print(s[j])
        if s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T':
            cnt += 1
            if cnt > ans:
                ans = cnt
        else:
            
            break

print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
l=list(s)
m=0
for i in range(len(l)):
    if l[i]!="A" and l[i]!="T" and l[i]!="C" and l[i]!="G":
        l[i]="."

print(l)
ss="".join(l)
ll=ss.split(".")
lll=[0]
for i in ll:
    lll.append(len(i))
print(max(lll))


s=input()
l=list(s)
m=0
for i in range(len(l)):
    if l[i]!="A" and l[i]!="T" and l[i]!="C" and l[i]!="G":
        l[i]="."

ss="".join(l)
ll=ss.split(".")
lll=[0]
for i in ll:
    lll.append(len(i))
print(max(lll))

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

acgt = ['']
while len(s) != 0:
	if s[0] == 'A' or s[0] == 'C' or s[0] == 'G' or s[0] == 'T':
		acgt[-1] += s.pop(0)
	else:
		s.pop(0)
		acgt.append('')
	print(acgt)

print(max([len(e) for e in acgt]))

s = list(input())

acgt = ['']
while len(s) != 0:
	if s[0] == 'A' or s[0] == 'C' or s[0] == 'G' or s[0] == 'T':
		acgt[-1] += s.pop(0)
	else:
		s.pop(0)
		acgt.append('')

print(max([len(e) for e in acgt]))

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
ACGT = set('A','C','G','T')
for i in range(1,len(S+1)):
  j = 1
  while j*i <= S:
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

S = input()

ans = 0
ACGT = set('A','C','G','T')
for i in range(1,len(S+1)):
  j = 1
  while j*i <= len(S):
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

S = input()

ans = 0
ACGT = set('A','C','G','T')
for i in len(1,S+1):
  j = 1
  while j*i <= S:
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        print (i,j,i+j)
        word = set(s[j:j+i])
        print (word)
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print(ans)

s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        word = set(s[j:j+i])
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print (ans)

Verdicts: Runtime Error

Runtime Error

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

l = list(input())
ans = []
ans.append(0)
count = 0
for i in range(len(l)):
  if l[i] == "A" or  l[i] == "G" or  l[i] == "T" or  l[i] == "C":
    count += 1
  else:
    ans.append(count)
    count = 0
    
ans.append(count)
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):
import sys
input = sys,sydin.readline

S = input().strip()
a = ['A', 'T', 'G', 'C']

ans = 0
j = []
for i in range(len(S)):
  j = i
  count = 0
  while True:
    if j >= len(S):
      break
    if S[j] in a:
      count += 1
      j += 1
    else:
      ans = max(ans, count)
      break
  
print(ans)

import sys
input = sys.stdin.readline

S = input().strip()
a = ['A', 'T', 'G', 'C']

ans = 0
j = []
for i in range(len(S)):
  j = i
  count = 0
  while True:
    ans = max(ans, count)
    if j >= len(S):
      break
    if S[j] in a:
      count += 1
      j += 1
    else:
      break
  
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):
str = input()
maxans = []
ans = []

for j in range(0,len(str)):
  for i in range(j,len(str)):
    print(str[i])
    if str[i] == 'A' or str[i] == 'C' or str[i] == 'G' or str[i] == 'T':
      ans.append(str[i])
    else:
      break
  if len(ans) >= len(maxans):
    maxans = ans
  ans = []
      
print(maxans)
print(len(maxans))

str = input()
maxans = []
ans = []

for j in range(0,len(str)):
  for i in range(j,len(str)):
    if str[i] == 'A' or str[i] == 'C' or str[i] == 'G' or str[i] == 'T':
      ans.append(str[i])
    else:
      break
  if len(ans) >= len(maxans):
    maxans = ans
  ans = []
      
print(len(maxans))

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

def chk(s):
	if s in 'ACGT':
		return 1
	else:
		return 0
c = 0
for i in s:
	c += chk(s)

print(c)

s = input()

c = 0
m = 0
for i in s:
	if s in 'ACGT':
		c += 1
		m = max(c,m)
    else:
		c = 0

print(m)

s = input()

c = 0
m = 0
for i in s:
	if i in 'ACGT':
		c += 1
		m = max(c,m)
	else:
		c = 0

print(m)

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()
temp=0
ans=0
tar="ACGT"
for ch in s:
  if ch in tar:
    temp+=1
  else:
    if ans=<temp:
      ans=temp
    temp=0

print(ans)




s=str(input())
temp=0
ans=0
tar="ACGT"
for ch in s:
  if ch is tar:
    temp+=1
  else:
    temp=0
    if ans<temp:
      ans=temp
print(ans)

s=input()
temp=0
ans=0
tar="ACGT"
for ch in s:
  if ch in tar:
    temp+=1
  else:
    ans=max(ans, temp)
    temp=0

print(max(ans,temp))




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

lst = []
for i in range(0, len(S)):
    for k in range(0, len(S)):
        if i > k:
            pass
        else:
            lst.append(S[i:k+1])
lst.append("")
lst_AGCT = []
for i in range(len(lst)):
    if "B" in lst[i] or "D" in lst[i] or "E" in lst[i] or "F" in lst[i] or "H" in lst[i] or "I" in lst[i] or "J" in lst[i] or "K" in lst[i] or "L" in lst[i] or "M" in lst[i] or "N" in lst[i] or "O" in lst[i] or "P" in lst[i] or "Q" in lst[i] or "R" in lst[i] or "S" in lst[i] or "U" in lst[i] or "V" in lst[i] or "W" in lst[i] or "X" in lst[i] or "Y" in lst[i] or "Z" in lst[i]:
        pass
    else:
        lst_AGCT.append(lst[i])

if lst_AGCT == [""]:
    print(0)
else:
    print(max(lst_AGCT, key=len))

S = input()

lst = []
for i in range(0, len(S)):
    for k in range(0, len(S)):
        if i > k:
            pass
        else:
            lst.append(S[i:k+1])
lst.append("")
lst_AGCT = []
for i in range(len(lst)):
    if "B" in lst[i] or "D" in lst[i] or "E" in lst[i] or "F" in lst[i] or "H" in lst[i] or "I" in lst[i] or "J" in lst[i] or "K" in lst[i] or "L" in lst[i] or "M" in lst[i] or "N" in lst[i] or "O" in lst[i] or "P" in lst[i] or "Q" in lst[i] or "R" in lst[i] or "S" in lst[i] or "U" in lst[i] or "V" in lst[i] or "W" in lst[i] or "X" in lst[i] or "Y" in lst[i] or "Z" in lst[i]:
        pass
    else:
        lst_AGCT.append(lst[i])

if lst_AGCT == [""]:
    print(0)
else:
    print(len(max(lst_AGCT, 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):
word = input()
print(len(word.("QWERYUIOPSDFHJKLZXVBNM")))

word = input()
num = [0]
index = 0
for i in word:
  if i.strip("ATCG") == "":
    num[index] += 1
  else:
    index += 1
    num.append(0)
print(max(num))

Verdicts: Runtime Error

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

Submission attempts (in order):
moji = str(input())
length = len(moji)
mojilst = list(moji)
ans = 0
temp = []
for i in range(length):
  if str(mojilst[i]) == "A" or str(mojilst[i]) == "G" or str(mojilst[i]) == "C" or str(mojilst[i]) == "T":
    temp.append(str(mojilst[i]))
  else:
    if len(ans) < len(temp):
      ans = len(temp)
    temp = []
print(ans)

moji = str(input())
length = len(moji)
mojilst = list(moji)
ans = 0
temp = []
for i in range(length):
  if str(mojilst[i]) == "A" or str(mojilst[i]) == "G" or str(mojilst[i]) == "C" or str(mojilst[i]) == "T":
    temp.append(str(mojilst[i]))
  else:
    if ans < len(temp):
      ans = len(temp)
    temp = []
    count += 1
if ans < len(temp):
      ans = len(temp)
print(ans)

moji = str(input())
length = len(moji)
mojilst = list(moji)
ans = 0
temp = []
for i in range(length):
  if str(mojilst[i]) == "A" or str(mojilst[i]) == "G" or str(mojilst[i]) == "C" or str(mojilst[i]) == "T":
    temp.append(str(mojilst[i]))
  else:
    if ans < len(temp):
      ans = len(temp)
    temp = []
if ans < len(temp):
      ans = len(temp)
print(ans)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
S = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
for i in range(len(S), 0, -1):
    for j in range(len(S) - i + 1):
        for k, s in enumerate(S[j:i + j]):
            print(S[j:i + j])
            if not s in acgt:
                break
            if k == len(S[j:i + j]) - 1:
                ans = len(S[j:i + j])
            
        if ans != 0:
            break
    else:
        continue
   
    break    
    
print(ans)

S = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
for i in range(len(S), 0, -1):
    for j in range(len(S) - i + 1):
        for k, s in enumerate(S[j:i + j]):
            if not s in acgt:
                break
            if k == len(S[j:i + j]) - 1:
                ans = len(S[j:i + j])
            
        if ans != 0:
            break
    else:
        continue
   
    break    
    
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):
T = list(map(str,input()))
print(T)

count = 0
flag1 = 0
list_count = []
for i in T:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        flag1 = 1
        count = count +1
    elif flag1 ==1:
        list_count.append(count)
        flag = 0
        count = 0
list_count.append(count)
print(max(list_count))


T = list(map(str,input()))

count = 0
flag1 = 0
list_count = []
for i in T:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        flag1 = 1
        count = count +1
    elif flag1 ==1:
        list_count.append(count)
        flag = 0
        count = 0
list_count.append(count)
print(max(list_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()

result = ""
result_old = ""



count = 0
for i in range(int(len(s))):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        result = result +s[i]
        count += 1
    else:
        if int(len(result_old)) <= int(len(result)):
            print("result_old=",result_old)
            result_old = result
        else:
            result = [None for _ in range(int(len(result)))]
            result = ""

if count == int(len(s)):
    result_old = result

if s == "A" or s == "C" or s == "G" or s == "T":
    result_old = "A"
print(len(result_old))

s = input()

len = 0
result = 0

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

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):
<?php

$s = trim(fgets(STDIN));
$count = [0];

$replace = preg_replace('/[^ACGT]/',',',$s);
$matchs = array_filter(explode(',',$replace));

foreach ($matchs as $m) {
    $count[] = strlen($m);
}

print(max($count) . "\n");

S = input()
T = set(list('AGCT'))

ans = 0
for l in range(len(S)):
    for r in range(l + 1, len(S) + 1):
        if set(S[l: r]) <= T:
            ans = max(ans, r - 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):
https://atcoder.jp/contests/abc128/tasks/abc128_a

Str = list(input())
tmp = 0
maxLen = 0

for s in Str:
    if s in "ACGT":
        tmp += 1
        maxLen = max(maxLen, tmp)
    else:
        tmp = 0


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

s=input()
s+="Z"
ans=0
cnt=0
for i in s:
    if i in ["A","T","C","G"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        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):
S = input()
maxlen = 0
l = 0
for s in S:
    if s in ["A", "T", "G", "C"]:
        l += 0
    else:
        if l > maxlen:
            maxlen = l
            l = 0
if l > maxlen:
    maxlen = l
print(maxlen)

S = input()
maxlen = 0
l = 0
for s in S:
    if s in ["A", "T", "G", "C"]:
        l += 1
    else:
        if l > maxlen:
            maxlen = l
            l = 0
if l > maxlen:
    maxlen = l
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()

l = ["A","C","G","T"]
res = 0

for i in range(len(s)):
    #print(i)
    tmp = 0
    print(s[i:])
    for j in s[i:]:
        if j in l:
            tmp += 1
        else:
            res = max(res,tmp)
            #print(res)
            break
    else:
        res = max(res,tmp)
else:
    print(res)


s = input()

l = ["A","C","G","T"]
res = 0

for i in range(len(s)):
    #print(i)
    tmp = 0
    #print(s[i:])
    for j in s[i:]:
        if j in l:
            tmp += 1
        else:
            res = max(res,tmp)
            #print(res)
            break
    else:
        res = max(res,tmp)
else:
    print(res)


Verdicts: Wrong Answer

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

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

result = [0]
i = 0
while i < len(s):
    counter = 0
    while i + counter < len(s):
        if s[i+counter] == 'A' or s[i+counter] == 'T' or s[i+counter] == 'G' or s[i+counter] == 'C':
            counter += 1
        else:
            result.append(counter)
            i += counter +1
print(result)

s = str(input())
s +='0'
result = [0]
i = 0
counter = 0
while i+counter < len(s):
    counter = 0
    h = 1
    while i + counter < len(s) and h == 1:
        if s[i+counter] == 'A' or s[i+counter] == 'T' or s[i+counter] == 'G' or s[i+counter] == 'C':
            counter += 1
        else:
            result.append(counter)
            i += counter +1
            h = 0
print(max(result))

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


s = str(input())
cnt, ans = 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
  else:
    if ans <= cnt:
      ans = cnt
    cnt = 0
print(ans)

s = list(input())
acgt = ["A", "C", "G", "T"]
cnt, ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if ans < cnt:
      ans = cnt
  else:
    cnt = 0
print(ans)


s = list(input())
acgt = ["A", "C", "G", "T"]
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
    if (ans < cnt):
      ans = cnt
  else:
    cnt = 0
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):
str = input()
max = 0
count = 0
for chr in str:
  if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
    count += 1
   	if count > max:
      max = count
  else:
  	count = 0
print({}.format(max))


str = input()
max = 0
count = 0
for chr in str:
	if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
		count += 1
   		if count > max:
        	max = count
  	else:
  		count = 0
print('{}'.format(max))

str = input()
max = 0
for chr in str:
  if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
    count += 1
   	if count > max:
      max = count
  else:
  	count = 0
print({}.format(max))

str = input()
max = 0
count = 0
for chr in str:
	if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
		count += 1
        if count > max:
        	max = count
	else:
		count = 0
print('{}'.format(max))

str = input()
max = 0
count = 0
for chr in str:
  if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
    count += 1
   	if count > max:
      max = count
  else:
  	count = 0
print('{}'.format(max))

str = input()
max = 0
count = 0
for chr in str:
	if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
		count += 1
		if count > max:
        	max = count
	else:
		count = 0
print('{}'.format(max))

str = input()
max = 0
count = 0
for chr in str:
    if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
        count += 1
        if count > max:
            max = count
    else:
        count = 0
print('{}'.format(max))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
S = input()
max_len = 0
for i in range(len(S)):
    for j in range(i+1, len(S)):
        s = S[i:j]
        s = s.replace('A', '.')
        s = s.replace('T', '.')
        s = s.replace('G', '.')
        s = s.replace('C', '.')
        flag = True
        for ss in s:
            if ss != '.':
                flag = False
                print(s)
        if flag:
            if max_len < len(s):
                max_len = len(s)
print(max_len)


S = input()
max_len = 0
for i in range(len(S)):
    for j in range(i+1, len(S)):
        s = S[i:j]
        s = s.replace('A', '.')
        s = s.replace('T', '.')
        s = s.replace('G', '.')
        s = s.replace('C', '.')
        flag = True
        for ss in s:
            if ss != '.':
                flag = False
                print(s)
        if flag:
            if max_len < len(s):
                max_len = len(s)
print(max_len)


S = input()
max_len = 0
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        s = S[i:j]
        s = s.replace('A', '.')
        s = s.replace('T', '.')
        s = s.replace('G', '.')
        s = s.replace('C', '.')
        flag = True
        for ss in s:
            if ss != '.':
                flag = False
        if flag:
            if max_len < len(s):
                max_len = len(s)
print(max_len)


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j]
    if s.strip("ACGT") == "":
      l.append(s)

m = sorted(l, key=len)
print(m[-1])

S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j]
    if s.strip("A C G T") == "":
      l.append(s)

m = sorted(l, key=len)
print(m[-1])


S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)
if len(l) == 0:
  print(0)
  exit()
      
m = sorted(l, reverse=True, key=len)
print(len(m[0]))


Verdicts: Wrong Answer

Wrong Answer

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

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

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


S = input()
max = 0
count = 0
for x in S :
    if x in "ATGC" :
        count += 1
    else :
        max = max(max, count)
        count = 0
max = max(max, count)
print(max)


S = input()
mx = 0
count = 0
for x in S :
    if x in "ATGC" :
        count += 1
    else :
        mx = max(mx, count)
        count = 0
mx = max(mx, count)
print(mx)


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):
def is_ATCG(str):
    for i in range(len(str)):
        chr=str[i]
        if(not(chr=='A' or chr=='T' or chr == 'C' or chr=='G')):
            return 0
    return 1

i_str=input()
max_len=0
len_str=len(i_str)

for i in range(len_str): 
    for j in range(i,len_str): 
        strA=i_str[i:j+1:1]
        if max_len < len(strA) and is_ATCG(strA):
            max_len = len(strA)
        print(strA + ' ' +str(max_len))
print(max_len)


def is_ATCG(str):
    for i in range(len(str)):
        chr=str[i]
        if(not(chr=='A' or chr=='T' or chr == 'C' or chr=='G')):
            return 0
    return 1

i_str=input()
max_len=0
len_str=len(i_str)

for i in range(len_str): 
    for j in range(i,len_str): 
        strA=i_str[i:j+1:1]
        if max_len < len(strA) and is_ATCG(strA):
            max_len = len(strA)
print(max_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()
N = len(S)
ans = 0
for i in range(N):
  for j in range(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)
ans = 0
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)

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

AGCT = ['A','G','C','T']
AGCT_list = []

i = 0
while i < len(S):
    print('i=',i)
    if S[i] in AGCT:
        k = 1
        agct_tmp = S[i]
        if i+k < len(S):
            while S[i+k] in AGCT:
                #print('k=', k)
                #print('i+k=',i+k)
                agct_tmp += S[i+k]
                if i+k+1 < len(S):
                    k +=1
                else:
                    break
    
        AGCT_list.append(agct_tmp)
        i = i + k + 1
    else:
        i += 1
if AGCT_list:
    print(max([len(string) for string in AGCT_list]))
else:
    print('0')
    
    

S = input()

AGCT = ['A','G','C','T']
AGCT_list = []

i = 0
while i < len(S):
    print('i=',i)
    if S[i] in AGCT:
        k = 1
        agct_tmp = S[i]
        while S[i+k] in AGCT:
            print('k=', k)
            print('i+k=',i+k)
            agct_tmp += S[i+k]
            if i+k+1 < len(S):
                k +=1
            else:
                break
    
        AGCT_list.append(agct_tmp)
        i = i + k + 1
    else:
        i += 1
if AGCT_list:
    print(max([len(string) for string in AGCT_list]))
else:
    print('0')
    

S = input()

AGCT = ['A','G','C','T']
AGCT_list = []

i = 0
while i < len(S):
    #print('i=',i)
    if S[i] in AGCT:
        k = 1
        agct_tmp = S[i]
        if i+k < len(S):
            while S[i+k] in AGCT:
                #print('k=', k)
                #print('i+k=',i+k)
                agct_tmp += S[i+k]
                if i+k+1 < len(S):
                    k +=1
                else:
                    break
    
        AGCT_list.append(agct_tmp)
        i = i + k + 1
    else:
        i += 1
if AGCT_list:
    print(max([len(string) for string in AGCT_list]))
else:
    print('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=list(input())
A=[0]*10
c=0
for i in range(10):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(A))

S=list(input())
A=[0]*10
c=0
for i in range(len(S)):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(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):
T = input()+"Z"  #T=ATCODERZ
x=["A","C","G","T"]
count=0
stock=[]

for i in range(len(T)):
  if T[i] in x:
    count += 1
    print(T[i])
  else:
    stock.append(count)
    count = 0

print(stock[-1])


T = input()+"Z"  #T=ATCODERZ
x=["A","C","G","T"]
count=0
stock=[]

for i in range(len(T)):
  if T[i] in x:
    count += 1
  else:
    stock.append(count)
    count = 0

print(stock[-1])


N=[a for a in input()]+["Z"]
count=0
lis=["A","G","C","T"]
ans=[]

for i in N:
  if i in lis:
    count+=1
  else:
    ans.append(count)
    count=0

print(max(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):
words = ''
w = []
flag = []
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    flag.append('True')
  else:
    flag.append('False')
print(S)
print(flag)

for j in range(len(S)):
  if flag[j] == 'True':
  	words += S[j]
  elif flag[j] == 'False':
    w.append(words)
    words = ''

print(len(max(w)))

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

print(MAX)

Verdicts: Runtime Error

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

Submission attempts (in order):
s = list(input())
count = []
count.append(0)
x = ["A","T","G","C"]
c = 0
for i in range(len(s)):
    if (s[i] in x) == True:
        c += 1
    else:
        count.append(c)
        c = 0
count.append(c)
print(count)

s = list(input())
count = [0]
x = ["A","T","G","C"]
c = 0
for i in range(len(s)):
    if (s[i] in x) == True:
        c += 1
    else:
        count.append(c)
        c = 0
count.append(c)
print(count)

s = list(input())
ans = 0
x = ["A","T","G","C"]
c = 0
for i in range(len(s)):
    if (s[i] in x) == True:
        c += 1
        if ans < c:
            ans = c
    else:
        c = 0
print(ans)

Verdicts: Wrong Answer

Wrong Answer

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

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

c_max = 0
cnt = 0

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

print(c_max)


S = input()

c_max = 0
cnt = 0

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()
     
if 'ACGT' in S:
  len('ACGT')
     

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
l = len(S)
count=0
ans= 0
for i in range(l):
  if S[i] in ["A" ,"C" ,"G","T"]:
    count +=1
  else:
    ans = count
    count=0

print(max(ans,count))


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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N,Q=map(int,input().split())
S=input()
L=[tuple(map(int, input().split())) for _ in range(Q)]
print("\n".join([str(len(S[nS-1:nE])-len(S[nS-1:nE].replace("AC", "|"))) for nS, nE in L]))


S=input()

c=m=0
for x in S:
  #print((m,c,x,"ACGT".find(x)))
  if "ACGT".find(x)<0:
    m = max(m, c)
    c = 0
  c+=1

print(m-1)


S=input()

c=m=0
for x in S:
  #print((m,c,x,"ACGT".find(x)))
  if "ACGT".find(x)>=0:
    c+=1
    m = max(m, c)
  else:
    c = 0

print(m)


Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
S = input()
ans = 0
cnt = 0
for i in range(len(S)):
  if S[i] == "A" or S[i] =="G" or S[i] =="C" orS[i] =="T":
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

S = 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 += 1
  else:
    ans = max(ans,cnt)
    cnt = 0

print(max(ans,cnt))


Verdicts: Runtime Error

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

Submission attempts (in order):
S=list(input())
print(S)
c=0
max=0
for i in range(len(S)) :
  if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T' :
    c+=1
    if c>max :
      max=c
  else :
    c=0
  
print(max)



S=list(input())

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

count = 0
result = []

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

max = result[0]
    
for j in range(len(result)):
  if max < result[j]:
    max = result[j]

print(max)

 S = input()

count = 0
result = []

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:
    result.append(count)
    count = 0

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)


S = str(input())

count = 0
result = []

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 i == len(S) - 1:
      result.append(count)
  else:
    result.append(count)
    count = 0
    if i == len(S) - 1:
      result.append(count)

maxi = result[0]
    
for j in range(len(result)):
  if maxi < result[j]:
    maxi = result[j]

print(maxi)


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
s = list(input())
key = ['A','T','G','C']

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


s = list(input())
key = ['A','T','G','C']

count = 0
ans = 0
for i in range(len(s)):
  if s[i] in key: count += 1
  else: count = 0
  ans = max(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=list(input())
cnt=0
ans=0
lis=["ATCG"]

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

s=list(input())
cnt=0
ans=0
lis=list("ATCG")

for i in s:
  if s[i] in lis:
    cnt+=1
    ans=max(ans,cnt)
  else:
    cnt=0
print(ans)

s=list(input())
cnt=0
ans=0
lis=["ATCG"]

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

import sys
input = sys.stdin.buffer.readline
input = sys.stdin.readline

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())

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














if __name__ == "__main__":
	main()


Verdicts: Runtime Error

Runtime Error

Wrong Answer

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

Submission attempts (in order):
a = input()
num=0
b=[]
for i in a:
  　　　　if i in 'ATGC':
    　　　　　　　num+=1
  　　　　else:
    　　　　　　　b.append(num)
    　　　　　　　num=0
print(max(b))
    

a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i]　in "ATGC":
    num=1
  else:
    b.appendS(num)
    num=0
print(max(b))
    

a = input()
num=0
b=[]
for i in a:
  if a in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))
    

a = input()
num=0
b=[]
for i in a:
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))
    

a = input()+"a"
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(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 = list(input())
acgt = ['A', 'C', 'G', 'T']

wlist=[]
answer=[]
for word in S:
    if word in acgt:
        wlist.append(word)
    else:
        print(wlist)
        answer.append(len(wlist))
        wlist=[]

print(max(answer))

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

c=0
ans=0
for word in S:
    c = c+1 if word in acgt else 0
    ans = max(ans, c)
print(ans)


Verdicts: Runtime Error

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

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Fri Apr  5 14:11:52 2019

@author: adachi-lab
"""

input_code = str(input('入力;'))
L1 = len(input_code)

list_3 = []
for w in range(L1):
    list_3.append(w)


x = 0
for i in range(L1):
    code = input_code[i]
    if code == 'A' or code == 'C' or code == 'G' or code == 'T':
        list_3.remove(x)
    
    x+=1

L3 = len(list_3)
list_4 = []

if list_3[0] == 0:
    for q in range(L3-1):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3-1]-1)
    print(list_4)
    
else:
    list_3.insert(0,0)
    list_4.append(list_3[1])
    for q in range(L3):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3]-1)
    list_4.pop(1)
    print(list_4)
    


print(max(list_4))

# -*- coding: utf-8 -*-
"""
Created on Fri Apr  5 16:48:09 2019

@author: adachi-lab
"""

input_code = input()
L1 = len(input_code)
list_3 = []
list_4 = []
list_5 = []

for w in range(L1):
    list_3.append(0)
    list_4.append(0)


for i in range(L1):
    code = input_code[i]
    if code == 'A' or code == 'C' or code == 'G' or code == 'T':
        list_3[i] = 1
        
c = 0

for n,m in zip(list_3,list_4):
    
    if n == m:
        c = 0
        list_5.append(c)
        
    else:
        c += 1
        list_5.append(c)
        
print(max(list_5))

Verdicts: Runtime Error

Accepted