Skip to content

Commit abd4c87

Browse files
committed
Finish question C
1 parent 3282562 commit abd4c87

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

アルゴリズム実技検定 過去問/第七回 アルゴリズム実技検定 過去問/C - 入力チェック.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,21 @@
1616
0≤L≤R≤10^9
1717
L と R は整数
1818
"""
19+
20+
21+
class Solution:
22+
@staticmethod
23+
def check_input(s: str, left: int, right: int) -> str:
24+
if s[0] == "0" and len(s) != 1:
25+
return 'No'
26+
27+
if left <= int(s) <= right:
28+
return 'Yes'
29+
else:
30+
return 'No'
31+
32+
33+
if __name__ == '__main__':
34+
S = input()
35+
L, R = map(int, input().split())
36+
print(Solution.check_input(S, L, R))

0 commit comments

Comments
 (0)