Past ABCs

AtCoder
IDabc350_a
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
ABC349
Output #1
Yes

`ABC349` is the abbreviation of a contest held and concluded on AtCoder last week.
Input #2
ABC350
Output #2
No

`ABC350` is this contest, which has not concluded yet.
Input #3
ABC316
Output #3
No

`ABC316` was not held on AtCoder.
API Response (JSON)
{
  "problem": {
    "name": "Past ABCs",
    "description": {
      "content": "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 ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc350_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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.\nDetermine if $S$ is the abbreviation of a contest ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments