Time Limit: 2 sec / Memory Limit: 256 MB
配点: 100 点
問題文
すぬけ君は、あるプログラミングコンテストのためにジャッジシステムを作りました。
このジャッジシステムにプログラムを提出すると、文字列 S からある連続する 2 文字を取り出した文字列が結果として返ってきます (どの連続する 2 文字も結果として返ってくることがありえます)。
このジャッジシステムにプログラムを提出した結果として AC
という文字列が返ってくることがありえるかどうか判定してください。
制約
- 2 \leq |S| \leq 5
- S は英大文字からなる。
入力
入力は以下の形式で標準入力から与えられる。
S
出力
ジャッジシステムにプログラムを提出した結果として AC
という文字列が返ってくることがありえるならば Yes
を、ありえないならば No
を出力せよ。
入力例 1
BACD
出力例 1
Yes
BACD
という文字列の 2 文字目と 3 文字目を取り出すと AC
という文字列になります。
入力例 2
ABCD
出力例 2
No
ABCD
という文字列の 1 文字目と 3 文字目を取り出してつなげると AC
という文字列になりますが、これらの文字は連続した 2 文字ではないので、
プログラムの提出結果として返ってくることはありません。
入力例 3
CABD
出力例 3
No
入力例 4
ACACA
出力例 4
Yes
入力例 5
XX
出力例 5
No
Score : 100 points
Problem Statement
Snuke built an online judge to hold a programming contest.
When a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in the string S as a contiguous substring. (The judge can return any two-character substring of S.)
Determine whether the judge can return the string AC
as the verdict to a program.
Constraints
- 2 \leq |S| \leq 5
- S consists of uppercase English letters.
Input
Input is given from Standard Input in the following format:
S
Output
If the judge can return the string AC
as a verdict to a program, print Yes
; if it cannot, print No
.
Sample Input 1
BACD
Sample Output 1
Yes
The string AC
appears in BACD
as a contiguous substring (the second and third characters).
Sample Input 2
ABCD
Sample Output 2
No
Although the string ABCD
contains both A
and C
(the first and third characters), the string AC
does not appear in ABCD
as a contiguous substring.
Sample Input 3
CABD
Sample Output 3
No
Sample Input 4
ACACA
Sample Output 4
Yes
Sample Input 5
XX
Sample Output 5
No