#P6382. 『MdOI R2』Car

『MdOI R2』Car

Problem Description

In MdOI City, to promote environmental protection, some vehicles are restricted from entering the urban area, called “traffic restriction” for short. Whether a car is restricted depends on its license plate number and the date.

The license plate is encoded as follows:

  • The first three characters are all uppercase letters, indicating the region.

  • The last five characters are uppercase letters or digits, serving as the identifier code. It is guaranteed that there is at least one digit.

  • The last digit of the plate is the first digit when scanning from right to left.

In this problem’s encoding, the first three characters for MdOI City are MDA. For example, a car in MdOI City with identifier code 6780P has the plate MDA6780P, and its last digit is 00.

In MdOI City, the traffic restriction rules are:

  1. For non-local cars (i.e., the first three characters are not MDA), they are restricted on all weekdays (Monday to Friday).
  2. For other local cars, certain last digits are restricted each day. The restricted last digits from Monday to Friday are as follows:
Date Monday Tuesday Wednesday Thursday Friday
Restricted last digit 11 and 99 22 and 88 33 and 77 44 and 66 55 and 00

Xiao C tells you her license plate number. She wants to know on which weekdays from Monday to Friday her car will be restricted. Please help her.

Input Format

One line containing a string of length 88, representing Xiao C’s license plate number.

Output Format

Output 55 digits. Each digit is 00 or 11, indicating whether Xiao C’s car is restricted from Monday to Friday, respectively. 11 means restricted, and 00 means not restricted.

MDA7U16D

0 0 0 1 0

ZJOI2020
1 1 1 1 1

Hint

【Help and Hints】

To make it easier for contestants to debug their code, this problem additionally provides three groups of samples. Since the samples are small, they are placed in one clipboard.

Additional samples


【Sample Explanation】

For Sample 1, the first three characters of the license plate are MDA, so it is a local plate. The last digit is 66, so it is restricted on Thursday.

For Sample 2, the first three characters of the license plate are ZJO, which is a non-local plate, so it is restricted from Monday to Friday.


【Constraints】

This problem uses bundled tests, meaning you can get the score for a subtask only if you pass all test points in that subtask. |Subtask ID|Special property|Score| |:-:|:-:|:-:| |Subtask 1|The first 33 characters are not MDA|3030| |Subtask 2|The last character is definitely a digit|3030| |Subtask 3|None|4040|

For all testdata, the first three characters are guaranteed to be uppercase letters. The last five characters may include uppercase letters or digits, and there is at least one digit.

Translated by ChatGPT 5