QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB

#23219. 車両の十部制

Statistics

ある交通規制では、車両の登録番号の末尾の数字が日付の末尾の数字と同じ場合、その車両は走行できません。5 台の車両のうち、この規則に違反する車両の台数を求めてください。

例えば、登録番号の末尾が $7$ の車両は $7$ 日、$17$ 日、$27$ 日に、末尾が $0$ の車両は $10$ 日、$20$ 日、$30$ 日に走行が制限されます。

入力

1 行目には日付の末尾の数字が与えられます。2 行目には 5 台の車両の登録番号の末尾の数字が与えられます。6 個の数はすべて 0 以上 9 以下の整数です。

出力

規則に違反する車両の台数を出力してください。

入出力例

入力 1

1
1 2 3 4 5

出力 1

1

入力 2

3
1 2 3 5 3

出力 2

2

入力 3

5
1 3 0 7 4

出力 3

0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.