#2784. ATCoder

0
    ID: 2784 传统题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>AtCoderabc122BGESP 3级字符串枚举(单层循环)

ATCoder

ATCoder

题目描述

You are given a string SS consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of SS. Here, a ACGT string is a string that contains no characters other than AA, CC, GG and TT.

输入格式

Input is given from Standard Input in the following format: SS

输出格式

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

ATCODER
3
HATAGAYA
5
SHINJUKU
0

提示

SS is a string of length between 11 and 1010 (inclusive). Each character in SS is an uppercase English letter.A substring of a string TT is a string obtained by removing zero or more characters from the beginning and the end of TT. For example, the substrings of ATCODERATCODER include TCOTCO, ATAT, CODERCODER, ATCODERATCODER and $$ (the empty string), but not ACAC.Among the ACGT strings that are substrings of ATCODERATCODER, the longest one is ATCATC.
Among the ACGT strings that are substrings of HATAGAYAHATAGAYA, the longest one is ATAGAATAGA.
Among the ACGT strings that are substrings of SHINJUKUSHINJUKU, the longest one is $$ (the empty string).

标签: AtCoder|abc122B

来源

AtCoder|abc122B