#abc249b. B - Perfect String
B - Perfect String
Score : points
问题描述
我们称一个由大写和小写英文字母组成的字符串为奇妙字符串,如果满足以下所有条件:
- 字符串中包含一个大写英文字母。
- 字符串中包含一个小写英文字母。
- 字符串中的所有字符两两不同。
例如,AtCoder
和 Aa
是奇妙字符串,而 atcoder
和 Perfect
则不是。
给定一个字符串 ,请确定 是否为奇妙字符串。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Let us call a string consisting of uppercase and lowercase English alphabets a wonderful string if all of the following conditions are satisfied:
- The string contains an uppercase English alphabet.
- The string contains a lowercase English alphabet.
- All characters in the string are pairwise distinct.
For example, AtCoder
and Aa
are wonderful strings, while atcoder
and Perfect
are not.
Given a string , determine if is a wonderful string.
Constraints
- is a string consisting of uppercase and lowercase English alphabets.
Input
Input is given from Standard Input in the following format:
Output
If is a wonderful string, print Yes
; otherwise, print No
.
Sample Input 1
AtCoder
Sample Output 1
Yes
AtCoder
is a wonderful string because it contains an uppercase English alphabet, a lowercase English alphabet, and all characters in the string are pairwise distinct.
Sample Input 2
Aa
Sample Output 2
Yes
Note that A
and a
are different characters. This string is a wonderful string.
Sample Input 3
atcoder
Sample Output 3
No
It is not a wonderful string because it does not contain an uppercase English alphabet.
Sample Input 4
Perfect
Sample Output 4
No
It is not a wonderful string because the -nd and the -th characters are the same.
update @ 2024/3/10 10:38:36