P26595 [AtCoder] Input Check
提高-
题目描述

Problem Description

You are given a string $ S $ consisting of digits from 0 to 9.
Determine if $ S $ satisfies both of the following conditions when viewed as an integer in decimal representation:

  • It does not have unnecessary leading zeros.
  • It is between $ L $ and $ R $ inclusive.

Input Format

The input is given from the standard input in the following format:

$ S $ $ L $ $ R $

Output Format

If $ S $ satisfies both conditions specified in the problem statement, output Yes. Otherwise, output No.

Sample Input and Output

Sample Input #1

13579
10000 20000

Sample Output #1

Yes

Sample Input #2

12345678901234567890
0 1000000000

Sample Output #2

No

Sample Input #3

05
5 5

Sample Output #3

No

Sample Input #4

0
0 1

Sample Output #4

Yes

Notes/Hints

Constraints

  • $ S $ is a string consisting of digits from 0 to 9
  • $1 \leq |S| \leq 100$
  • $0 \leq L \leq R \leq 10^9$
  • $ L $ and $ R $ are integers

Sample Explanation 1

$ 13579 $ does not have unnecessary leading zeros and is between $ 10000 $ and $ 20000 $ inclusive, so it satisfies the conditions. Therefore, output Yes.

Sample Explanation 2

The integer represented by $ S $ can be larger than the maximum value that can be represented by a 64-bit integer type.

Sample Explanation 3

$ 05 $ has unnecessary leading zeros, so it does not satisfy the conditions. Therefore, output No.

Sample Explanation 4

Note that the leading 0 in $ 0 $ is not an unnecessary leading zero.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
13579 10000 20000
样例输出
Yes