103500: [Atcoder]ABC350 A - Past ABCs

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

Description

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.

Input

Output

分数:100分

问题描述

你得到了一个长度为6的字符串$S$。可以保证$S$的前三个字符是ABC,后三个字符是数字。

判断$S$是否表示在本次比赛开始前,在AtCoder上举行并结束的比赛的缩写。

一个字符串$T$是“在本次比赛开始前,在AtCoder上举行并结束的比赛的缩写”,当且仅当它等于以下348个字符串中的一个:

ABC001, ABC002, $\ldots$, ABC314, ABC315, ABC317, ABC318, $\ldots$, ABC348, ABC349

注意ABC316不包括在内。

约束

  • $S$是一个长度为6的字符串,其中前三个字符是ABC,后三个字符是数字。

输入

输入从标准输入以以下格式给出:

$S$

输出

如果$S$是表示在本次比赛开始前,在AtCoder上举行并结束的比赛的缩写,打印Yes;否则,打印No


样例输入1

ABC349

样例输出1

Yes

ABC349是上周在AtCoder上举行并结束的比赛的缩写。


样例输入2

ABC350

样例输出2

No

ABC350是本次比赛,尚未结束。


样例输入3

ABC316

样例输出3

No

ABC316没有在AtCoder上举行。

加入题单

上一题 下一题 算法标签: