AtCoder Beginner Contest 122
翻译中…
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.
翻译中…
Note
翻译中…
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$.
翻译中…
样例
Input #1
ATCODER
Output #1
3
Among the ACGT strings that are substrings of `ATCODER`, the longest one is `ATC`.
Input #2
HATAGAYA
Output #2
5
Among the ACGT strings that are substrings of `HATAGAYA`, the longest one is `ATAGA`.
Input #3
SHINJUKU
Output #3
0
Among the ACGT strings that are substrings of `SHINJUKU`, the longest one is `` (the empty string).
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。