TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
b = int(input())

if b == A:
  print("T")
elif b == T:
  print("A")
elif b == G:
  print("C")
else:
  print("G")

ソースコード 

Copy
Copy
b = int(input())
 
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
else:
  print("G")

b = int(input())
 
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
else:
  print("G")

b = input()
 
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
else:
  print("G")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

if s == 'A':
    print('T')
elif s == 'T':
    print('A')
elif s == 'G':
    print('C')
elif s == 'C':
    print('G')

s = input()

if s == 'A':
    print('T')
elif s == 'T':
    print('A')
elif s == 'G':
    print('C')
elif s == 'C':
    print('G')

Verdicts: Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
n, q = map(int, input().split())
s = str(input())
lists = list(list(map(int, input().split())) for i in range(q))
AC_index = []
counter = 0

for i in range(n-1):
    if s[i] + s[i+1] == 'AC':
        AC_index.append(i)

for i in range(q):
    l, r = (lists[i][0]-1), (lists[i][1]-1)
    for j in AC_index:
        if l <= j <= r-1:
            counter += 1
    print(counter)
    counter = 0


X = str(input())

words = {
    'A': 'T',
    'T': 'A',
    'C': 'G',
    'G': 'C'
}

print(words[X])

Verdicts: Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

if b == "A":
    print("T")
elif b == "T":
    print("A")
eif b == "G":
    print("C")
else:
    print("G")

b = input()

if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "G":
    print("C")
else:
    print("G")

Verdicts: Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
else:
  print('C')


Verdicts: Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
b = input()
dic = {'A':'T', 'C':'G'}

s = dic.get(b)
if s == None:
    if b == 'T':
        print('A')
    else:
        print('C')


b = input()
dic = {'A':'T', 'C':'G'}

s = dic.get(b)
if s == None:
    if b == 'T':
        print('A')
    else:
        print('C')
else:
    print(s)

Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

if s == 'A':
    print('C')
elif s == 'C':
    print('A')
elif s == 'G':
    print('T')
else:
    print('G')



s = input()

if s == 'A':
    print('T')
elif s == 'C':
    print('G')
elif s == 'G':
    print('C')
else:
    print('A')



Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

b = input()

if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')  

Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
n, q = list(map(int, input().split()))
s = input()
for i in range(q):
    l, r = list(map(int, input().split()))
    print(len(s[l - 1:r].split("AC")) - 1)


b=input()

if b=="A":
    print("T")
elif b=="T":
    print("A")
elif b=="C":
    print("G")
else:
    print("C")

Verdicts: Runtime Error

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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


b=str(input())
if b=='A':
    print('T')
elif b=='C':
    print('G')
elif b=='G':
    print('C')
else:
    print('A')


Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
def helix(x):
  if x in 'AT':
    return 'AT'.replace(x, '')
  elif x in 'GC':
    return 'GC'.replace(x, '')

b=input()
c={ 'A' : 'T' , 'T' : 'A' , 'C' : 'G' , 'G': 'C' }
print(c[b])

Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

Submission attempts (in order):
s = input()
m = 0
c = 0
S = {"A", "C", "G", "T"}
for i in range(len(s)):
    if s[i] in S:
        c += 1
    else:
        if c != 0:
            if c > m:
                m = c
            c = 0

if c > m:
    m = c

print(m)

a = input()
if a == "A":
  print("T")
elif a == "C":
  print("G")
elif a == "G":
  print("C")
else:
  print("A")

Verdicts: Wrong Answer

Accepted
Problem: On the Planet AtCoder, there are four types of bases: `A`, `C`, `G` and `T`. `A` bonds with `T`, and `C` bonds with `G`.  You are given a letter b as input, which is `A`, `C`, `G` or `T`. Write a program that prints the letter representing the base that bonds with the base b.

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

s =  input()
if(s == "A"):
    print("T")
elif(s == "T"):
    print("A")
elif(s == "C"):
    print("G")
elif(s == "G"):
    print("C")

Verdicts: Wrong Answer

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

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

str = []
ans = []

for i in range(len(s)):
    if s[i] in "ACGT":
        str.append(s[i])
    else:
        ans.append(len(str))
        str = []
print(max(ans))
print(ans)

S = input()

ACGT = 'ACGT'

count = []
tmp_num = 0
for i in S:
    if i in ACGT:
        tmp_num += 1
    elif i not in ACGT:
        count.append(tmp_num)
        tmp_num = 0
count.append(tmp_num)

print(max(count))

Verdicts: Runtime Error

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

Submission attempts (in order):
s = input()
list_s = list(s)
k = 0
ans = 0
for c in list_s:
    if c == "A" or c == "C" or c == "G" or c == "T":
        k += 1

print(ans)

s = input()
list_s = list(s)
k = 0
ans = []
for i in range(len(list_s)):
    c = list_s[i]
    if c == "A" or c == "C" or c == "G" or c == "T":
        k += 1
    else:
        ans.append(k)
        k = 0
if k != 0:
    ans.append(k)
print(max(ans))

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
list_S = [S]
ch = 0
an = 0
for i in S :
  if i in list_S:
    ch += 1
  else :
    an = max(an, ch)
    ch = 0
print(an)

S = input()
i = ["A","G","C","T"]
list_S = [S]
ch = 0
an = 0
for j in S :
  if j in i :
    ch += 1
  else :
    an = max(an, ch)
    ch = 0
print(max(an,ch))

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())
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        string += s
    else:
        s_list.append(string)
        string=""
max(map(len, s_list))

S = input()
s_list=[]
string= ""
AGCT = ["A", "G", "C", "T"]
for s in S:
    if s in AGCT:
        #string = string + s
        string += s
    else:
        s_list.append(string)
        string=""
s_list.append(string)
print(max(map(len, s_list)))

Verdicts: Runtime Error

Runtime Error

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

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

base_pairs = {
    'A': 'T', 
    'C': 'G',
    'G': 'C',
    'T': 'A',
}

pair = base_pairs.get(b)

print(pair)


S = input()

answer = ''
number_of_consecutive_times = 0
maxium_number_of_consecutive_times = 0
for char in S:
    is_included = char in ['A', 'C', 'G', 'T']

    if is_included:
        number_of_consecutive_times += 1
        maxium_number_of_consecutive_times = max(
            number_of_consecutive_times,
            maxium_number_of_consecutive_times,)
    else:
        number_of_consecutive_times = 0

print(maxium_number_of_consecutive_times)


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
print(map(len,re.finditer('[ACGT]*',input())))

import re
print(max(map(len,re.finditer('[ACGT]*',input()))))

import re
print(max(x.end()-x.start() for x in re.finditer('[ACGT]*',input())))

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

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

s = input()
k = 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":
        k += 1
    else:
        ans = max(ans, k)
        k = 0

ans = max(ans, k)
print(ans)

Verdicts: Runtime Error

Wrong Answer

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

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

ans = 0
tmp_ans = 0
for i in s:
    if i in t:
        tmp_ans += 1
        print(i)
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0
ans = max(tmp_ans, ans)
print(ans)

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

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


s = input()
a = 0
t = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        t += 1
    else:
        if t > a:
            a = t
            t = 0
if t > a:
	a = t
print(a)


Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
print(max(1,s.count("A"))*max(1,s.count("T"))*max(1,s.count("G"))*max(1,s.count("C")))


s=input()
print(s.count("A")*s.count("T")*s.count("G")*s.count("C"))

s=input()
print(max(1,s.count("A"))+max(1,s.count("T"))+max(1,s.count("G"))+max(1,s.count("C")))


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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
import itertools
# ACGT
S = list(input())

index_num =[]

ACGT = list("ACGT")

for i in ACGT:
    index_num.append([n for n, v in enumerate(S) if v == i])


aaa =sorted(list(itertools.chain.from_iterable(index_num)))
#print(aaa)
cnt =0
max_cnt =0

for i in range(len(aaa)-1):
    if aaa[i]+1 == aaa[i+1]:
        cnt +=1
    else:
        cnt =0
    max_cnt = max(max_cnt,cnt)
print(max_cnt)




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

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
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: Runtime Error

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

Submission attempts (in order):
import re

S = input()

pattern = "[A|T|G|C]+"
match_result = re.findall(pattern, S)

ans = 0
for word in match_result:
    if ans <= len(word): ans = len(word)



import re

S = input()

pattern = "[A|T|G|C]+"
match_result = re.findall(pattern, S)

ans = 0
for word in match_result:
    if ans <= len(word): ans = len(word)

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 = [s for s in input()]

Answer_list = []
DNA = ['A','T','G','C']
fragment = ''

for x in S:
  if x in DNA:
    fragment += x
    
  else:
    Answer_list.append(fragment)
    fragment = ''
Answer_list.append(fragment)
sorted_Answer_list = sorted(Answer_list)     
print(sorted_Answer_list[-1])

S = input()
N = len(S)
x = 0
for a in range(N):
  for b in range(a+1,N+1):
    if all(x in 'ATGC' for x in S[a:b]):
      x = max(x, b-a)
      
      
print(x)
    
  
      

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
for si in s:
    if si in acgt:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
    #print(ans)
print(ans)

s = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
for si in s:
    if si in acgt:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
    #print(ans)
print(ans)

s = input()
acgt = ['A', 'C', 'G', 'T']
ans = 0
cnt = 0
for si in s:
    if si in acgt:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
    #print(ans)
print(ans)

Verdicts: Runtime Error

Runtime Error

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

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

pattern = '[A|C|G|T]+'

# findall 
results = re.findall(pattern, S, re.S)

if len(results) == 0 :
    print(0)
else :
    print(max(results))

import re
S = input()

pattern = '[A|C|G|T]+'

# findall 
results = re.findall(pattern, S, re.S)

if len(results) == 0 :
    print(0)
else :
    print(len(max(results,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):
import re

print ('AC' if re.match(r'\AA[a-z]+C[a-z]+\Z', input()) else 'WA')  


import re

m = re.findall(r'[ATCG]+', input())
print(max([len(x) for x in m]) if m else '0')


Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
L=['A','T','G','C']
ans=0
M=0
for i in range(s):
  if s[i] in L:
    ans += 1
  else:
    if ans > M:
      M = ans
    ans = 0
print(M)

s=input()
L=['A','T','G','C']
ans=0
M=0
for i in range(len(s)):
  if s[i] in L:
    ans += 1
  else:
      if ans > M:
          M = ans
          ans = 0
if ans > M:
    M = ans
    ans = 0
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() ; c = 0 ; l = []

for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        c += 1
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        l.append(c)
        c = 0
        
print(l(max))
            

s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
ans += [c]
if ans == []:
    print(len(s))
else:
    print(max(ans))


Verdicts: Runtime Error

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

Submission attempts (in order):
def resolve():
    n=int(input())
    l=list(map(int, input().split()))
    ans='YES'
    l.sort()
    for i in range(n-1):
        if l[i]==l[i+1]:
            ans='NO'
    print(ans)

resolve()

def resolve():
    s=input()
    cnt=0
    ans=0
    for i in s:
        if i in ['A','T','C','G']:
            cnt+=1
            ans=max(ans,cnt)
        else:
            cnt=0
    print(ans)
resolve()

Verdicts: Runtime Error

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

Submission attempts (in order):
import re
import numpy as np
s = 'ATGCKKAA'
s = input()
atgcs = re.split(r'[^ATGC]', s)
lens = np.array(list(map(len, atgcs)))
ret = atgcs[lens.argmax()]
print(ret)

import re
import numpy as np
s = input()
atgcs = re.split(r'[^ATGC]', s)
lens = np.array(list(map(len, atgcs)))
ret = atgcs[lens.argmax()]
print(ret)


import re
import numpy as np
s = input()
atgcs = re.split(r'[^ATGC]', s)
lens = np.array(list(map(len, atgcs))).max()
print(lens)


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 hantei(n):
    for i in range(len(n)):
        if n[i]!="A" and n[i]!="G" and n[i]!="T" and n[i]!="C":
            return False

s=input()
T=[]
n=[]
m=[]
x=0

for i in range(len(s)-1):
    for j in range(i+1,len(s)):
        T.append(s[i:j+1])

flag=False
for i in range(len(T)):
    w=T[i]
    if hantei(w)!=False:
        n.append(w)

for i in range(len(n)):
    m.append(len(n[i]))

if not m:
    print(0)
else:
    print(m)
    print(n)

def hantei(n):
    for i in range(len(n)):
        if n[i]!="A" and n[i]!="G" and n[i]!="T" and n[i]!="C":
            return False

s=input()
T=[]
n=[]
m=[]
x=0

for i in range(len(s)-1):
    for j in range(i+1,len(s)):
        T.append(s[i:j+1])

for i in range(len(s)):
    T.append(s[i])

flag=False
for i in range(len(T)):
    w=T[i]
    if hantei(w)!=False:
        n.append(w)


for i in range(len(n)):
    m.append(len(n[i]))

if not m:
    print(0)
else:
    print(max(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):
SHINJUKU

x=input()
N=len(x)
maxl=0
for i in range(N):
  if (x[i]=="A")or(x[i]=="T")or(x[i]=="G")or(x[i]=="C"):
    j=1
    while (i+j<N):
      if ((x[i+j]=="A")or(x[i+j]=="T")or(x[i+j]=="G")or(x[i+j]=="C")):
        j=j+1
      else:
        break
    if maxl<j:
      maxl=j
      maxi=i
    
print(maxl)

Verdicts: Runtime Error

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

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

str_max = 0
print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)):
        if {"A","C","G", "T"} |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)

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()
S = list(S)
str_list =  {"A","C","G","T"}
str_max = 0
print(S)
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)+1):
        S_list = S[start:end]

        if str_list | set(S_list) == str_list:
            str_max = max(str_max, len((S_list)))
           
        #else:
           

print(str_max)

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

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 = str(input())
A = 'ACGT'
L = len(S)

cnt = 0
max_cnt = 0
for x in S:
    print(x, cnt)
    if x in A:
        cnt += 1
    else:
        if max_cnt < cnt:
            max_cnt = cnt
        cnt = 0

print(max_cnt)


S = str(input())
A = 'ACGT'
L = len(S)

cnt = 0
max_cnt = 0
for x in S:
    if x in A:
        cnt += 1
    else:
        if max_cnt < cnt:
            max_cnt = cnt
        cnt = 0
if max_cnt < cnt:
    max_cnt = cnt

print(max_cnt)


Verdicts: Wrong Answer

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

Submission attempts (in order):
s = list(x for x in input())
temp = 0
ans = []
for i in range(len(s)):
  if s[i] == 'A' or i == 'C' or i =='G' or i =='T':
    temp += 1
    if i == len(s) - 1:
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))


s = list(x for x in input())
temp = 0
ans = []
for i in s:
  if i == 'A' or i == 'C' or i =='G' or i =='T':
    temp += 1
    if i == len(s-1):
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))


s = list(x for x in input())
temp = 0
ans = []
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'C' or s[i] =='G' or s[i] =='T':
    temp += 1
    if i == len(s) - 1:
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))


Verdicts: Wrong Answer

Runtime Error

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

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

m_len=0
len=0

acgt={'A','C','G','T'}

for i in S:
    if i in acgt:
        len+=1
        #print(i,len)
    else:
        #print(i,len,m_len)
        if len>m_len:
            m_len=len
        len=0
        
len>m_len
m_len=len

print(m_len)


S=input()

m_len=0
len=0

acgt={'A','C','G','T'}

for i in S:
    if i in acgt:
        len+=1
        #print(i,len)
    else:
        #print(i,len,m_len)
        if len>m_len:
            m_len=len
        len=0
        
if len>m_len:
    m_len=len

print(m_len)

Verdicts: Wrong Answer

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

Submission attempts (in order):
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if s[i] in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if str(s[i]) in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

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

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):
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]=="A" and Ss[i]=="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
if len(anss)!=0:
    print(max(anss))
else:
    print(0)

Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
        anss.append(counter)
if len(anss)!=0:
    print(max(anss))
else:
    print(0)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input().strip()
ans = 0
l = 0
for _s in s:
  if s in ['A', 'C', 'G', 'T']:
    l += 1
  else:
    ans = max(ans, l)
print(max(ans, l))


s = input().strip()
ans = 0
l = 0
for _s in s:
  if _s in ['A', 'C', 'G', 'T']:
    l += 1
  else:
    ans = max(ans, l)
    l = 0
print(max(ans, l))


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
pattern = re.compile('[ACGT]+')
S = input()
print(re.findall(pattern, S))
print(len(max(re.findall(pattern, S), key=len, default='')))

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

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


import itertools
S = input()
ans = 0
for i,j in itertools.combinations(range(len(S)+1), 2):
    if all('ACTG'.count(c)==1 for c in S[i:j]):
        ans = max(ans, len(S[i:j]))
print(ans)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
str = input()
ans = ''
tmp = ''
for s in str:
  if (s in ['A', 'T', 'G', 'C']):
    tmp += s
    if (len(tmp) > len(ans):
        ans = tmp
  else:
    tmp = ''

print(ans)
    

str = list(input())

tmp = ''
ans = ''
for s in str:
  if (s in ['A', 'T', 'G', 'C']):
    tmp += s
    if (len(tmp) > len(ans)):
      ans = tmp
  else:
    tmp = ''

print(ans)

str = list(input())

tmp = ''
ans = ''
for s in str:
  if (s in ['A', 'T', 'G', 'C']):
    tmp += s
    if (len(tmp) > len(ans)):
      ans = tmp
  else:
    tmp = ''

print(len(ans))

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
src = input()
length = len(src)
acgt = set("ACGT")
ans = 0
for i in range(length):
    n = length - i
    for ngram in [src[k:k+n] for k in range(length - n + 1)]:
        print(ngram)
        subtract = len(set(ngram) - acgt)
        if subtract == 0:
            ans = n
            break
    if ans != 0:
        break
print(ans)

src = input()
length = len(src)
acgt = set("ACGT")
ans = 0
for i in range(length):
    n = length - i
    for ngram in [src[k:k+n] for k in range(length - n + 1)]:
        subtract = len(set(ngram) - acgt)
        if subtract == 0:
            ans = n
            break
    if ans != 0:
        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()
dic_ = str.maketrans({'T':'1','A':'1','C':'1','G':'1'})
s = s.translate(dic_)
count = 0
result = 0
pre_i = ''
print(s)

for i in s:
  if pre_i == '1' and i == '1':
    count += 1
  elif pre_i =='1':
    if count > result:
      result = count
    count = 0
    pre_i = ''
  
  elif i == '1':
    count += 1
    pre_i = '1'
print(result)

s = input()
atcg = ["A","T","C","G"]

max_len = 0
now = 0
for char in s:
    if char not in atcg:
        max_len = max(now,max_len)
        now = 0
        continue
    now += 1
print(max(now,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):
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0, temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)

ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0
temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)

Verdicts: Runtime Error

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

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


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

Verdicts: Runtime Error

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

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

s = list(input())
n = len(s)
res = 0
for i in range(n):
    for j in range(i,n):
        temp = s[i:j+1]
        if all(i in 'ATGC' for i in temp):
            res = max(res,len(temp))
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):
str = input()
ans = []
allow = ["A","C","G","T"]
count = 0
for s in str:
  if s in allow:
    count = count + 1
    
if len(ans) == 0:
  print(0)
else:
  print(sorted(ans)[-1])

str = input()
ans = []
allow = ["A","C","G","T"]
ans_str = ""
for index in range(len(str)):
  if str[index] in allow:
    ans_str = ans_str + str[index]
  else:
    ans.append(ans_str)
    ans_str = ""
    continue

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

str = input()
ans = []
allow = ["A","C","G","T"]
count = 0
for s in str:
  if s in allow:
    count = count + 1
    
if len(ans) == 0:
  print(0)
else:
	print(sorted(ans)[-1])

str = input()
ans = []
allow = ["A","C","G","T"]
count = 0
for s in str:
  if s in allow:
    count = count + 1
    ans.append(count)
  else:
    count = 0
    
if len(ans) == 0:
  print(0)
else:
  print(sorted(ans)[-1])

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):
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
        array.append(0)
    elif flag == True and S[i] == 'C':
        count += 1
        array.pop(-1)
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    if ff != True:
        print(0)
    if len(array[arr[0]-1:arr[1]-1]) < 2:
        print(0)
        continue
    for a in array[arr[0]-1:]:
        if a == -1:
            flag = True
        elif flag == True:
            minv = a
            break
    for b in reversed(array[:arr[1]]):
        if b != 0 and b != -1:
            maxv = b
            break
    if minv == maxv:
        print(1)
    else:
        print(maxv - minv + 1)


h = input()
S = list(h)

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

flag = False
count = 0
maxt = 0
for i in range(len(S)):
    for s in range(len(S)):
        s = s + i
        if len(S) <= s:
            if maxt <= count:
                maxt = count
            break
        if flag == False and (S[s] in atc):
            flag = True
            count += 1
        elif flag == True and (S[s] in atc):
            count += 1
        elif flag == True:
            break
        if maxt < count:
            maxt = count
    count = 0
    flag = False
print(maxt)

Verdicts: Runtime Error

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

Submission attempts (in order):
n, q = map(int ,input().split())
s = list(input())
for i in range(q):
    l, r = map(int, input().split())
    ss = ''.join(s[l-1:r])
    ans = ss.count('AC')
    print(ans)

s=input()+'Z'

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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

b = 0

ans = []

for i in s:
  if (i == 'A' or i == 'G' or i == 'C' or i == 'T'):
    b += 1
  else:
    ans.append(b)
    b = 0

print(max(ans))   

S = list(input())

b = 0

ans = [0]

for n, i in enumerate(S, 1):
  if (i == 'A' or i == 'G' or i == 'C' or i == 'T'):
    b += 1
  else:
    b = 0
  ans.append(b)
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()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

print(s,s2)

tmp = 0
ret = 0
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
        tmp = 0
ret = max(ret, tmp)
print(ret)


s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
        tmp = 0
ret = max(ret, tmp)
print(tmp)


s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

print(s,s2)

tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
ret = max(ret, tmp)
print(tmp)


s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'

tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        tmp = 0
        ret = max(ret, tmp)
ret = max(ret, tmp)
print(tmp)


s = input()
s2 = ''
for c in s:
    if c in ('A','T','C','G'):
        s2 += '1'
    else:
        s2 += '0'


tmp = 0
ret = 0
for c in s2:
    if c == '1':
        tmp += 1
    else:
        ret = max(ret, tmp)
        tmp = 0
ret = max(ret, tmp)
print(ret)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
s = input()
SENT = ('A','T','G','C')

ans = 0
count = 0
for c in s:
  if c in SENT:
    count += 1
  else:
    ans = max(ans,conut)
    count = 0
else:
  ans = max(ans,count)
  
print(ans)

s = input()
SENT = ('A','T','G','C')

ans = 0
count = 0
for c in s:
  if c in SENT:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
else:
  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):
def main():
    s = input()

    ans = 0
    for i in range(len(s)):
        cur = 0
        for j in range(i,len(s)):
            if s[j] in {"A", "C", "G", "T"}:
                cur += 1
            else:
                break

            ans = max(cur, ans)


    print(ans)

def main():
    s = input()

    ans = 0
    for i in range(len(s)):
        cur = 0
        for j in range(i,len(s)):
            if s[j] in {"A", "C", "G", "T"}:
                cur += 1

            else:
                break

            ans = max(cur, ans)


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

l=len(S)

ans=0
ans_list=()

for i in range(l):
    if S[i] in ("A","G","C","T"):
        ans+=1
    else:
        ans_list.append(ans)
        ans=0
ans_list.append(ans)
print(ans)
    

s = input()
t = ''
for i in range(len(s)):
    if s[i] in ('A', 'C', 'G', 'T'):
        t += '1'
    else:
        t += '0'
print(t)
print(t.split('0'))
print(max(map(len, t.split('0'))))

S=input()

l=len(S)

ans=0
ans_list=[]

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

Verdicts: Runtime Error

Wrong Answer

Accepted