Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
長さ 6 の文字列 S が与えられます。S の先頭 3 文字は ABC
であり、末尾 3 文字は数字であることが保証されます。
Sが、このコンテスト開始以前に AtCoder上で開催され終了したコンテストの略称であるかどうか判定してください。
ただし、文字列 T が「このコンテスト開始以前に AtCoder上で開催され終了したコンテストの略称」であるとは、以下の 348 個の文字列のうちいずれかに等しいことと定めます。
ABC001
, ABC002
, \ldots, ABC314
, ABC315
, ABC317
, ABC318
, \ldots, ABC348
, ABC349
特に ABC316
が含まれないことに注意してください。
制約
- S は先頭 3 文字が
ABC
、末尾 3 文字が数字である長さ 6 の文字列
入力
入力は以下の形式で標準入力から与えられる。
S
出力
Sが、このコンテスト開始以前に AtCoder上で開催され終了したコンテストの略称であるなら Yes
、そうでないなら No
と出力せよ。
入力例 1
ABC349
出力例 1
Yes
ABC349
は先週AtCoder上で開催され終了したコンテストの略称です。
入力例 2
ABC350
出力例 2
No
ABC350
はこのコンテストです。まだ終了していません。
入力例 3
ABC316
出力例 3
No
ABC316
はAtCoder上で開催されていません。
Score: 100 points
Problem Statement
You are given a string S of length 6. It is guaranteed that the first three characters of S are ABC
and the last three characters are digits.
Determine if S is the abbreviation of a contest held and concluded on AtCoder before the start of this contest.
Here, a string T is "the abbreviation of a contest held and concluded on AtCoder before the start of this contest" if and only if it equals one of the following 348 strings:
ABC001
, ABC002
, \ldots, ABC314
, ABC315
, ABC317
, ABC318
, \ldots, ABC348
, ABC349
.
Note that ABC316
is not included.
Constraints
- S is a string of length 6 where the first three characters are
ABC
and the last three characters are digits.
Input
The input is given from Standard Input in the following format:
S
Output
If S is the abbreviation of a contest held and concluded on AtCoder before the start of this contest, print Yes
; otherwise, print No
.
Sample Input 1
ABC349
Sample Output 1
Yes
ABC349
is the abbreviation of a contest held and concluded on AtCoder last week.
Sample Input 2
ABC350
Sample Output 2
No
ABC350
is this contest, which has not concluded yet.
Sample Input 3
ABC316
Sample Output 3
No
ABC316
was not held on AtCoder.