#P3156. 【深基15.例1】询问学号
【深基15.例1】询问学号
Problem Description
There are students entering the classroom one after another. We know each student’s ID number (between and ), given in the order they enter the classroom. Class starts, and the teacher wants to know what the ID number of the -th student who entered the classroom is (the first student to enter has ). The number of queries does not exceed .
Input Format
The first line contains integers and , representing the number of students and the number of queries.
The second line contains integers, representing the ID numbers in the order they enter the classroom.
The third line contains integers, representing queries asking for which student (by entry order) to check.
Output Format
Output integers as the answers, separated by newlines.
10 3
1 9 2 60 8 17 11 4 5 14
1 5 9
1
8
5
Hint
Translated by ChatGPT 5