I. 2024夏-A-2 Finding the Owner

    传统题 150ms 64MiB

2024夏-A-2 Finding the Owner

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

The picture above shows a note left by a programmer who found a bag for the owner, with a very clever two-way encryption: "I found a bag downstairs. Please contact me if you see it! My phone number: 1832834xxxx". He claimed that the first two "xx" are "the 8th and 9th digits of your ID number", the next "x" is "the 5th digit of your ID number", and the last "x" is "the last digit of your ID number". Now given the programmer's complete mobile phone number and the ID numbers of a large group of people, please find the owner.

输入格式

Each input file contains one test case. The 1st line gives the 11-digit phone number of the programmer, and the 2nd line gives a positive integer nn (105\le 10^5). Then nn lines follow, each contains an 18-digit ID number. For the sake of privacy protection, those ID numbers are not real. It is only guaranteed that each ID is an 18-digit number.

输出格式

Output in a line the ID number of the owner. It is guaranteed that the answer is unique.

样例

18328349823
10
130124198703030914
412901197609212008
450703198308160035
412928194606180028
413921194910290412
240902197104212813
371521198711123153
140113196511250117
622922200306127013
342520198912300017
371521198711123153

限制

对于所有的测试用例,限制为150 ms, 64 MB

PAT2024夏季重现赛

未参加
状态
已结束
规则
IOI
题目
11
开始于
2025-8-10 14:00
结束于
2025-8-10 17:30
持续时间
3.5 小时
主持人
参赛人数
37