102811: [AtCoder]ABC281 B - Sandwich Number

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

Score : $200$ points

Problem Statement

You are given a string $S$ consisting of uppercase English letters and digits. Determine whether $S$ satisfies the following condition.

  • $S$ is a concatenation of the following characters and string in the order listed.
    • An uppercase English letter
    • A string of length $6$ that is a decimal representation of an integer between $100000$ and $999999$, inclusive
    • An uppercase English letter

Constraints

  • $S$ consists of uppercase English letters and digits.
  • The length of $S$ is between $1$ and $10$, inclusive.

Input

The input is given from Standard Input in the following format:

$S$

Output

If $S$ satisfies the condition in the problem statement, print Yes; otherwise, print No.


Sample Input 1

Q142857Z

Sample Output 1

Yes

$S$ 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 $6$ that is a decimal representation of an integer between $100000$ and $999999$, so $S$ satisfies the condition.


Sample Input 2

AB912278C

Sample Output 2

No

AB is not an uppercase English letter, so $S$ does not satisfy the condition.


Sample Input 3

X900000

Sample Output 3

No

The last character of $S$ is not an uppercase English letter, so $S$ does not satisfy the condition.


Sample Input 4

K012345K

Sample Output 4

No

012345 is not a string of length $6$ that is a decimal representation of an integer between $100000$ and $999999$, so $S$ does not satisfy the condition.

Input

题意翻译

给定一个字符串,需满足下列条件: + 字符串长度为 $8$。 + 首位是大写字母。 + $2 \sim 7$ 位可以组成一个六位数。(注意六位数首位不能为 $0$) + 末位是大写字母。 判断给定的字符串是否满足要求。 translated by @[liangbowen](https://www.luogu.com.cn/user/367488)。

Output

分数:$200$分 部分 问题描述 你有一个由大写英文字母和数字组成的字符串$S$。确定$S$是否满足以下条件。 - $S$是以下字符和字符串按列出的顺序连接而成的。 - 一个大写英文字母 - 一个长度为$6$的字符串,表示介于$100000$和$999999$之间的整数的十进制表示(包括$100000$和$999999$) - 一个大写英文字母 部分 约束条件 - $S$由大写英文字母和数字组成。 - $S$的长度在$1$到$10$之间(包括$1$和$10$)。 输入输出格式 输入格式 输入按照以下格式从标准输入给出: $S$ 输出格式 如果$S$满足问题描述中的条件,打印`Yes`;否则,打印`No`。 样例输入 1 Q142857Z 样例输出 1 Yes $S$按照这个顺序由`Q`、`142857`和`Z`连接而成。 `Q`和`Z`是大写英文字母,`142857`是一个长度为$6$的字符串,表示介于$100000$和$999999$之间的整数的十进制表示,因此$S$满足条件。 样例输入 2 AB912278C 样例输出 2 No `AB`不是大写英文字母,所以$S$不满足条件。 样例输入 3 X900000 样例输出 3 No $S$的最后一个字符不是大写英文字母,所以$S$不满足条件。 样例输入 4 K012345K 样例输出 4 No `012345`不是一个长度为$6$的字符串,表示介于$100000$和$999999$之间的整数的十进制表示,所以$S$不满足条件。

加入题单

算法标签: