QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 2048 MB 満点: 100

#14446. 十人賓果遊戲

統計

Bingo 是一種多人參與的機率遊戲。每位玩家會收到一張寫有若干數字的紙,接著遊戲主持人會以隨機順序喊出這些數字。玩家將聽到的數字劃掉,最先將紙上所有數字劃掉的玩家即贏得遊戲。這個基本版本的遊戲以「平淡無奇」著稱,除了不要睡著之外,玩家不需要進行任何特別的動作。

在本題中,我們將分析一種需要剛好十位玩家的特定 Bingo 版本。在我們的版本中,稱為「十人 Bingo」(Ten Player Bingo),每位玩家的編號從 1 到 10。每位玩家會收到一張紙,上面包含所有 1 到 100 之間,且個位數與該玩家編號的個位數相同的整數。遊戲主持人也拿到了一張紙,上面包含 1 到 100 的每個整數各一次,但這些整數已被打亂。遊戲主持人將依照紙上呈現的順序讀出這些整數。當一位玩家聽到了所有屬於他們的整數時,他們會大喊「BINGO」並離開遊戲。遊戲持續進行直到每個人都喊過「BINGO」。

請問最後一位喊出「BINGO」的玩家是誰?

輸入格式

輸入的第一行也是唯一的一行包含 100 個整數,每個整數範圍在 1 到 100 之間。保證每個整數恰好出現一次。

輸出格式

輸出一個整數,代表最後一位喊出「BINGO」的玩家編號。

範例

輸入格式 1

12 91 49 4 52 95 45 51 50 40 11 5 88 87 39 38 42 89 76 85 30 69 35 81 23 67 32 3 62 8 79 58 1 75 37 27 24 46 18 16 97 61 41 59 13 74 78 54 98 66 14 33 86 55 83 93 63 72 6 19 92 17 56 64 100 53 28 71 7 96 36 57 84 43 73 60 15 77 80 31 20 99 21 90 70 22 26 10 25 2 94 9 82 34 65 68 48 29 44 47

輸出格式 1

7

說明

請注意,範例輸入 1 為了顯示方便被拆分為十行,實際資料會全部在同一行。

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.