#abc327a. A - ab
A - ab
Score : points
问题描述
给定一个长度为 的由小写英文字母组成的字符串 。
如果在 中存在相邻的 a
和 b
,则输出 Yes
;否则,输出 No
。(a
和 b
的顺序无关紧要。)
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string of length consisting of lowercase English letters.
If there are any adjacent occurrences of a
and b
in , print Yes
; otherwise, print No
. (The order of a
and b
does not matter.)
Constraints
- is a string of length consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
If there are any adjacent occurrences of a
and b
in , print Yes
; otherwise, print No
.
Sample Input 1
3
abc
Sample Output 1
Yes
The string abc
has a
as the first character and b
as the second character, which are adjacent. Thus, print Yes
.
Sample Input 2
2
ba
Sample Output 2
Yes
The string ba
has a
as the second character and b
as the first character, which are adjacent. (Note that the order of a
and b
does not matter.)
Sample Input 3
7
atcoder
Sample Output 3
No
update @ 2024/3/10 01:50:29