Problem:


Score : 200 points

Problem Statement

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.

Notes

A substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.

For example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and  (the empty string), but not AC.

Constraints

S is a string of length between 1 and 10 (inclusive).

Each character in S is an uppercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

Print the length of the longest ACGT string that is a substring of S.

Sample Input 1

ATCODER

Sample Output 1

3

Among the ACGT strings that are substrings of ATCODER, the longest one is ATC.

Sample Input 2

HATAGAYA

Sample Output 2

5

Among the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.

Sample Input 3

SHINJUKU

Sample Output 3

0

Among the ACGT strings that are substrings of SHINJUKU, the longest one is  (the empty string).



Sample input:
ATCODER


Sample output:
3

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

auto print = [](auto &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
};

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 0;
  rep(i, s.size()) {
    rep(j, i + 1) {
      bool flag = true;
      FOR(k, j, i + 1) {
        if(s[k] != 'A' && s[k] != 'C' && s[k] != 'G' && s[k] != 'T') flag = false;
      }
      if(flag) ans = max(ans, i - j + 1);
    }
  }
  out(ans);
  return 0;
}

Submission status: Runtime Error

Solution code:
s = input()
len_li = []
cnt = 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:
        len_li.append(cnt)
        cnt = 0 
print(max(len_li))

Submission status: Runtime Error

Solution code:
s = list(input())
ACGT = ['A', 'C', 'G', 'T']

count = 0
result = []
for w in s:
    if w in ACGT:
        count += 1
    else:
        result.append(count)
        count = 0

print(max(result))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import re

S = input()

m = re.search(r"[ACGT]+", S)
print(len(m.group()))

Submission status: Runtime Error

Solution code:
s = input()
acgt = ["A","C","G","T"]
res = []
parts = ""

for i in range(len(s)):
    parts = ""
    for c in s[i:]:
        if c in acgt:
            parts += c
        else:
            res.append(len(parts))
            break

print(max(res))

Submission status: Runtime Error

Solution code:
S=input()
b=["A","T","G","C"]
cntl=[]
cnt=0
for i in S:
    if i in b:
        cnt+=1
    else:
        cntl.append(cnt)
        cnt=0
print(max(cntl))

Submission status: Runtime Error

Solution code:
S=input()

ans_lst=[]
ans=0
for s in S:
    if s in ['A','C','G','T']:
        ans+=1
    else:
        ans_lst.append(ans)
        ans=0

print(max(ans_lst))

Submission status: Runtime Error

Solution code:
S=list(input())
v=0
ls=[]
for i in range(len(S)):
  for j in range(i,len(S)):
    if S[j]=="A" or S[j]=="T" or S[j]=="G" or S[j]=="C":
      v+=1
    else:
      ls.append(v)
      v=0
      break
print(max(ls))

Submission status: Runtime Error

Solution code:
s=input()
ans=''
lis=[]
for i in s:
    if i in 'ATGC':
        ans += i
    else:
        lis.append(ans)
        ans=''
print(len(max(lis)))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
l = []
for s in S:
  if s not in ['A', 'T', 'C', 'G']:
    l.append(count)
    count = 0
  else:
    count += 1
l.sort()
print(l[-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

results = []

cnt = 0
results = []

for i in range(len(S)):
    if S[i] in ['A', 'C', 'G', 'T']:
        cnt += 1
    else :
        results.append(cnt)
        cnt = 0
        
print(max(results))

Submission status: Runtime Error

Solution code:
S = input()
ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    else:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Submission status: Runtime Error

Solution code:
S = input()
ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in "ACGT":
        ans = ans + 1
        if i == (len(S)-1):
            ans_lis.append(ans)
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Submission status: Runtime Error

Solution code:
import re

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

print(ans)

Submission status: Runtime Error

Solution code:
import re

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

print(ans)

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ["A","C","G","T"]

ans = 0 
ans_lis = []

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Submission status: Runtime Error

Solution code:
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)))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
for S in s:
  if S == "A":
    ans += 1
  elif S == "G":
    ans += 1
  elif S == "T":
    ans += 1
  elif S == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)
s = input()
ans = 0
for S in s:
  if S == "A":
    ans += 1
  elif S == "G":
    ans += 1
  elif S == "T":
    ans += 1
  elif S == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
for s in S:
  if s == "A":
    ans += 1
  elif s == "G":
    ans += 1
  elif s == "T":
    ans += 1
  elif s == "C":
    ans += 1
  else:
    ans = 0
    
print(ans)

Submission status: Runtime Error

Solution code:
S = str(input())
ans = []
for i in range(len(S)):
    for k in range(i,len(S)):
        if all("ACGT".count(c)==1 for c in S[i:k+1]):
            ans.append(len(S[i:k+1]))
print(max(ans))

Submission status: Runtime Error

Solution code:
S = str(input())
ans = []
for i in range(len(S)):
    for k in range(i+1,len(S)):
        if all("ACGT".count(c)==1 for c in S[i:k]):
            ans.append(len(S[i:k]))
print(max(ans))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
S = input()

d = set(['A', 'T', 'C', 'G'])
ans = 0
nums = list()
for s in S:
    if s in d:
        ans += 1
    else:
        nums.append(ans)
        ans = 0
print(max(nums))

Submission status: Runtime Error

Solution code:
s = input()

res = []

for i in range(len(s)):
    for j in range(i, len(s)):
        check = s[i:j+1]
        if len(check) == check.count("A")+check.count("T")+check.count("C")+check.count("G"):
            res.append(len(check))
print(max(res))

Submission status: Runtime Error

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

print(max(ans))

Submission status: Runtime Error

Solution code:
def main():
	# a,b,k = map(int,input().split())
	# n,k = map(int,input().split())
	s = list(str(input()))
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)
	avoid = 0
	ans = 0
	ans_rec = []
	for i in range(len(s)):
		if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
			# print("when i = {} is true".format(i))
			ans += 1
		else:
			ans_rec.append(ans)
			ans = 0
			
	print(max(ans_rec))

 
if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
s=input()
a=0
A=[]
for i in range(len(s)):
    if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
        a+=1
        A.append(a)
    else:
        a=0
print(max(A))

Submission status: Runtime Error

Solution code:
s=input()
a=0
A=[]
for i in range(len(s)):
    if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
        a+=1
    else:
        A.append(a)
        a=0
print(max(A))

Submission status: Runtime Error

Solution code:
s=[i for i in input()]
l=[]
cnt=0
for i in s:
  if i=="A" or i=="T" or i=="C" or i=="G" or i==" ":
    cnt+=1
    if i==(len(s)-1):
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0
print(max(l) if len(l)>1 else l[0])

Submission status: Runtime Error

Solution code:
s=[i for i in input()]
l=[]
cnt=0
for i in s:
  if i=="A" or i=="T" or i=="C" or i=="G" or i==" ":
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0
print(max(l) if len(l)>1 else l[0])

Submission status: Runtime Error

Solution code:
s=[i for i in input()]
l=[]
cnt=0
for i in s:
  if i=="A" or i=="T" or i=="C" or i=="G" or i==" ":
    cnt+=1
  else:
    l.append(cnt)
    cnt=0
print(max(l) if len(l)>1 else l[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import re
s = input()
match = re.findall(r"[ACGT]+",s)
print(max([len(i) for i in match]))

Submission status: Runtime Error

Solution code:
S = list(input())
count = 1 if S[0] in lis else 0
lis = ['A','T','C','G']
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)

Submission status: Runtime Error

Solution code:
S = input()

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        

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

Submission status: Runtime Error

Solution code:
S = input()

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        
if len(ans) == 0:
    print(0)
else:
    max(ans)

Submission status: Runtime Error

Solution code:
S = input()

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()

list_ = []
length = 0

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

Submission status: Runtime Error

Solution code:
A, = [s.split() for s in open(0)]
A = A[0]
acgt = []
for i in range(len(A)):
    for j in range(len(A), 0, -1):
        sub_string = A[i:j]
        for s in sub_string:
            if s not in ["A", "C", "G", "T"]:
                break 
        else:
            acgt.append(sub_string)
print(max([len(s) for s in acgt]))

Submission status: Runtime Error

Solution code:
s=input()
cnt=0
lis=[]
for i in range(len(s)):
  if s[i]=='A' or s[i]=='T' or s[i]=='C' or s[i]=='G':
    cnt+=1
  else:
    lis.append(cnt)
    cnt=0
print(max(lis))

Submission status: Runtime Error

Solution code:
S = input()
AA = ["A", "C", "G", "T"]

ans = []
ll = 0
for i in range(len(S)):
    if S[i] in AA:
        ll += 1
    else:
        ans.append(ll)
        ll = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
max_re = 0
for i in range(len(s)):
    tar_s = s[i:]
    tar_s = re.search(r'(A|T|C|G)*', tar_s).group()
    max_re = max(max_re, len(tar_s))
print(max_re)

Submission status: Runtime Error

Solution code:
s = input()

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


ans = []
count = 0
for i in range(len(s)):
    for j in s[i:]:
        if j in acgt:
            count += 1
        else:
            ans.append(count)
            count = 0
            break
            
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
Ans =[]
dic = ["A","T","G","C"]
rmp =""
for i in range(len(S)):
  if S[i] in dic:
    rmp += S[i]
  else:
    Ans.append(len(rmp))
    rmp = ""
print(max(Ans))

Submission status: Runtime Error

Solution code:
A = list(input())
S = ['A','C','G','T']
count = 0
a = []
for i in A:
  if i in S:
    count += 1
  else:
    a.append(count)
    count = 0
print(max(a))

Submission status: Runtime Error

Solution code:
S=list(input())

n=len(S)
l=list("ACGT")
ans=[]

for i in range(7):
  count=0
  for j in range(i,7):
    if S[j] in l:
      count+=1
    else:
      break
  ans.append(count)
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()

ans = 0
ACGT = ("A", "C", "G", "T")

count = 0
count_list = []
for s in S:
    if s not in ACGT:
        count_list.append(count)
        count = 0
        continue
    else:
        count += 1
print(max(count_list))

Submission status: Runtime Error

Solution code:
s=input()
L=[]
c=0
for i in range(len(s)):
    if s[i] in "ACGT":
        c+=1
    else:
        L.append(c)
        c=0
print(max(L))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
S = input()
l = []
a = ["A", "C", "G", "T"]
n = 0
for i in S:
  if i in a:
    n += 1
  else:
    l.append(n)
    n = 0
print(max(l))

Submission status: Runtime Error

Solution code:
# 2019-11-12 22:21:08(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    s = sys.stdin.readline().rstrip()
    
    permitted = 'ACGT'
    continuous_count = []
    count = 0

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



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
s=list(str(input()))
li=["A","C","G","T"]
ans=0
x=[]
for i in range(0,len(s)):
  if s[i] in li:
    ans+=1
    x.append(ans)
  else:
    ans=0
        
print(max(x))

Submission status: Runtime Error

Solution code:
S = input()

max_length = 0
for i in range(len(S)):
  if S[i] in "ACGT":
    if i == len(S) - 1:
      length = 1
    else:
      for j in range(i+1, len(S)):
        if S[j] in "ACGT":
          length = j - i + 1
        else:
          break

    if length > max_length:
      max_length = length

print(max_length)

Submission status: Runtime Error

Solution code:
S = input()

length = 0
for i in range(len(S)):
  if S[i] in "ACGT":
    for j in range(i+1, len(S)):
      if S[j] in "ACGT":
        continue
      else:
        break
    if j - i > length:
      length = j - i

print(length)

Submission status: Runtime Error

Solution code:
s=input()
l=['A','C','G','T']
index_s=[]
count=0
for i in range(len(s)):
    if s[i] not in l:
        index_s+=[i]
    
    else:
        count+=1
        if count==len(s):
            print(len(s))
            exsit()
    
ans=[index_s[0]]
for i in range(len(index_s)-1):
    ans+=[index_s[i+1]-index_s[i]-1]

ans.sort()    
print(ans[-1])

Submission status: Runtime Error

Solution code:
s=input()
l=['A','C','G','T']
index_s=[]
for i in range(len(s)):
    if s[i] not in l:
        index_s+=[i]
        
ans=[index_s[0]]
for i in range(len(index_s)-1):
    ans+=[index_s[i+1]-index_s[i]-1]

ans.sort()    
print(ans[-1])

Submission status: Runtime Error

Solution code:
S = input()

count_list = []
for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        count_list.append(True)
    else:
        count_list.append(False)

l = len(S)
freq_list = []
for i in range(l):
    count = 0
    for j in range(l-i):
        if count_list[i+j] is True:
            count += 1
        else:
            freq_list.append(count)
            break

print(max(freq_list))

Submission status: Runtime Error

Solution code:
s = list(input())

ans = 0
key_lst =  ['A', 'T', 'C', 'G']
ans_lst = []

for i in s:
    if i in key_lst:
        ans += 1
    else:
        ans_lst.append(ans)
        ans = 0

print(max(ans_lst))

Submission status: Runtime Error

Solution code:
s = list(input())

ans = 0
key_lst =  ['A', 'T', 'C', 'G']
ans_lst = []

for i in s:
    if i in key_lst:
        ans += 1
    else:
        ans_lst.append(ans)
        ans = 0

print(max(ans_lst))

Submission status: Runtime Error

Solution code:
S = "".join([i if i in 'ACGT' else ' ' for i in input()])
print(max([len(i) for i in S.split()]))

Submission status: Runtime Error

Solution code:
S = str(input())
count = 0
X =[]
for s in S:
    if s == 'A' or s == 'T' or s == 'C' or s == 'G':
        count += 1
    else:
        X.append(count)
        count = 0
print(int(max(X)))

Submission status: Runtime Error

Solution code:
S = str(input())
count = 0
X =[]
for s in S:
    if s == 'A' or s == 'T' or s == 'C' or s == 'G':
        count += 1
    else:
        X.append(count)
print(int(max(X)))

Submission status: Runtime Error

Solution code:
s = input()
L = ["A","C","G","T"]

counter = 0
ans_L = []
for val in s:
    if val in L:
        counter += 1
    else:
        ans_L.append(counter)
        counter = 0

print(max(ans_L))

Submission status: Runtime Error

Solution code:
S = input()
 
partial = ""
 
conditions = ["A","T","G","C"]
 
conlist = []
 
con = 0
 
for i in range(0,len(S)):
	if S[i] in conditions:
		for j in range(0,i+1):
			if S[j] in conditions:
				con +=1
			if (S[j] not in conditions) or j == i:
				conlist.append(con)
				con = 0
				
 
print(max(conlist))

Submission status: Runtime Error

Solution code:
S = input()

partial = ""

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

conlist = []

con = 0

for i in range(0,len(S)):
	if S[i] in conditions:
		for j in range(0,i):
			if S[j] in conditions:
				con +=1
			if (S[j] not in conditions) or j == i:
				conlist.append(con)
				con = 0
				

print(max(conlist))

Submission status: Runtime Error

Solution code:
S = input()

partial = ""

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

conlist = []

con = 0

for i in range(0,len(S)):
	if S[i] in conditions:
		for j in range(0,i+1):
			if S[j] in conditions:
				con +=1
			if (S[j] not in conditions) or j == i:
				conlist.append(con)
				con = 0
				

print(max(conlist))

Submission status: Runtime Error

Solution code:
s=str(input())

lens=len(s)
ans=0
list=[]

for i in range(lens):
	if (s[i]=='A')|(s[i]=='T')|(s[i]=='C')|(s[i]=='G'):
		ans=ans+1
	else:
		list.append(ans)
		ans=0

#print(list)
print(max(list))

Submission status: Runtime Error

Solution code:
S = input()
for i in range(len(S)):
    if S[i] == "A" or "C" or "G" or "T":
        for j in range(i+1,len(S)):
            if S[j] == "A" or "C" or "G" or "T":
                continue
            else:
                tmp = j-i
                break
print(tmp)

Submission status: Runtime Error

Solution code:
s=input()
b=[]
c=0
for i in range(len(s)):
    #print(i)
    for j in range(i,len(s)):
        if s[j] in ["A","T","C","G"]:
            c+=1
        else:
            b.append(c)
            c=0
print(b)
print(max(b))
#HATAGAYAのyについてうまく機能してない

Submission status: Runtime Error

Solution code:
S = list(input())
ans = 0
i = 0
lst = ["A","C","G","T"]
while i < len(S):
    cnt = 0
    if S[i] in lst:
        cnt = 1
        for j in range(1 , 4):
            if not S[j + i] in lst or i + j >= len(S):
                break
            cnt += 1
        ans = cnt
    i += j
print(ans)

Submission status: Runtime Error

Solution code:
S = list(input())
ans = 0
i = 0
lst = ["A","C","G","T"]
while i < len(S) - 1:
    cnt = 0
    if S[i] in lst:
        cnt = 1
        for j in range(4):
            j += 1
            if not S[j] in lst:
                break
            cnt += 1
        ans = cnt
    i += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())
ok = ["A", "C", "G", "T"]

len_list = []
tmp = 0

for l in S:
    if l in ok:
        tmp += 1
    else:
        len_list.append(tmp)
        tmp = 0

print(max(len_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
ans = []
cnt = 0
for i in range(len(s)):
  if s[i] in set("ATCG"):
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
s=input()
len_=[]

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

Submission status: Runtime Error

Solution code:
difficult

Submission status: Runtime Error

Solution code:
#122c
N,Q = map(int, input().split())
S = str(input())

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

Submission status: Runtime Error

Solution code:
s=input()
print(s.replace("A","1"))
s.replace("C","1")
s.replace("G","1")
s.replace("T","1")
c=0
for s[i] in range(len(s)):
  for if i=='1':
    c+=1
    
print(c)

Submission status: Runtime Error

Solution code:
import re;print(len(max(re.findall(r"[ACGT]+",input()),key=len)))

Submission status: Runtime Error

Solution code:
s = list(input())
ctn = 0
for i in s:
    if i in ['A', 'G', 'C', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(ctn)

Submission status: Runtime Error

Solution code:
n = input()
l=[]
count=0
for i in range(len(n)):
    if n[i]=="A" or n[i]=="C" or n[i]=="G" or n[i]=="T":
        count+=1
    else:
        l.append(count)
        count=0
print(max(l))

Submission status: Runtime Error

Solution code:
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+1-i)
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
word=list(s)
temp=[]
score=[]
for i in range(len(word)):
  if word[i]!='A' and word[i]!='C' and word[i]!='G' and word[i]!='T':
    temp.append(i+1)
if word[0]=='A' or word[0]=='C' or word[0]=='G' or word[0]=='T':
  temp.insert(0,0)
if word[-1]=='A' or word[-1]=='C' or word[-1]=='G' or word[-1]=='T':
  temp.append(len(word)+1)
print(temp)
for i in range(len(temp)-1):
  if temp[i]==0 or temp[i+1]==len(word)+1:
    score.append(temp[i+1]-temp[i]-1)
  else:
    score.append(temp[i+1]-temp[i]-1)
print(max(score))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <iostream>
using namespace std;

typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < n; i++)

/* print like python */
void print() {cout << endl;}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " "; print(forward<Tail>(tail)...);}
template <class T> void print(vector<T> &vec) { for (auto& a : vec) { cout << a; if (&a != &vec.back()) cout << " "; } cout << endl; }
template <class T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec); } }

bool check(char c){
    return (c=='A' || c=='C' || c=='G' || c=='T');
}
int main()
{
    string s;
    cin >> s;
    int ans=0,cnt=0;
    REP(i,s.length()){
        if(check(s[i])){
            cnt +=1;
            ans = max(ans,cnt);
        }else{
            cnt=0;
        }
    }
    print(ans);

}

Submission status: Runtime Error

Solution code:
S = list(input())
ans = 0
count = 0
for i in len(S):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        if ans < count:
            ans = count
        else:
            pass
        count = 0
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
x=[]
c=0
for i in range(len(s)):
    if s[i]in['A','C','G','T']:
        c+=1
    else:
        x.append(c)
        c=0
print(max(x))

Submission status: Runtime Error

Solution code:
D = ["A","T","G","C"]
S = input().strip()
N = len(S)
for k in range(N):
    for i in range(k+1):
        ind = 1
        for j in range(i,i+N-k):
            if S[j] not in D:
                ind = 0
                break
        if ind == 1:
            cnt = N-k
            break
    if ind==1:break
print(cnt)

Submission status: Runtime Error

Solution code:
s = list(input())
count = 0
a = []
for i in range(len(s)):
    if s[i] =="A" or s[i] =="T" or s[i] =="G" or s[i] =="C":
        count += 1
    else:
        a.append(count)
        count = 0
print(max(a))

Submission status: Runtime Error

Solution code:
a=['A','C','G','T']
x=input()
b=[]
x=list(x)
count=0
size=0
for i in range (len(x)):
  if x[i] in a:
    count+=1
  else:
    b.append(count)
    count = 0
print(max(b))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
l=[c for c in input()]
l1=[-1]
l2=[]
for i,j in enumerate(l):
  if j not in 'ACGT':
    l1.append(i)
for i in range(len(l1)-1):
  l2.append(l1[i+1]-l1[i]-1)
print(max(l2))

Submission status: Runtime Error

Solution code:
s=input()

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

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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):
      ans.append(temp)
  else:
    ans.append(temp)
    temp = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
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
  else:
    ans.append(temp)
    temp = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
import re

s = input()
pat = r"[ACGT]+"
atgc = re.findall(pat, s)
ress = []
for i in atgc:
    ress.append(len(i))

print(max(ress))

Submission status: Runtime Error

Solution code:
n=list(str(input()))
s=0
for i in range(len(n)):
  if n[i]=="A"or"T":
    s=s+1
  elif n[i]="C"or"G":
    s=s+1
print(s)

Submission status: Runtime Error

Solution code:
str = input()
n = lent(str)
counter = []
max = 0
for i in range(n):
  counter[i] = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(input())
i=0
li = []
num = 0
while i<=len(s)-1:
    
    s1 = ["A","C","G","T"]
    
    if s[i] in s1 :
        num += 1
        i += 1
        li.append(num)
    elif s[i] not in s1 :
        num = 0
        i += 1
        
print(max(li))

Submission status: Runtime Error

Solution code:
s = input()

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

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

print(mx)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    else:
        if count > max_count:
            max_count += count
print(max_count

Submission status: Runtime Error

Solution code:
S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        arr.append(st)
        st = ""
    if s in L:
        st += s

print(max(map(len, arr)))

Submission status: Runtime Error

Solution code:
s=list(input())
t=0
ans=0
for i in range(len(s)):
    if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
        t+=1
    else:
        if t>=1:
            if ans<t:
            ans=t
        t=0
print(int(ans))