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 (). Then 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