#abc281b. B - Sandwich Number
B - Sandwich Number
Score : points
问题陈述
你将得到一个由大写英文字母和数字组成的字符串 。请确定该字符串 是否满足以下条件。
- 是按照以下字符和字符串顺序拼接而成的。
- 一个大写英文字母
- 一个长度为 的字符串,表示一个介于 到 (包含两端点)之间的十进制整数
- 一个大写英文字母
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string consisting of uppercase English letters and digits. Determine whether satisfies the following condition.
- is a concatenation of the following characters and string in the order listed.
- An uppercase English letter
- A string of length that is a decimal representation of an integer between and , inclusive
- An uppercase English letter
Constraints
- consists of uppercase English letters and digits.
- The length of is between and , inclusive.
Input
The input is given from Standard Input in the following format:
Output
If satisfies the condition in the problem statement, print Yes
; otherwise, print No
.
Sample Input 1
Q142857Z
Sample Output 1
Yes
is a concatenation of Q
, 142857
, and Z
in this order.
Q
and Z
are uppercase English letters, and 142857
is a string of length that is a decimal representation of an integer between and , so satisfies the condition.
Sample Input 2
AB912278C
Sample Output 2
No
AB
is not an uppercase English letter, so does not satisfy the condition.
Sample Input 3
X900000
Sample Output 3
No
The last character of is not an uppercase English letter, so does not satisfy the condition.
Sample Input 4
K012345K
Sample Output 4
No
012345
is not a string of length that is a decimal representation of an integer between and , so does not satisfy the condition.
update @ 2024/3/10 11:47:57