There are many Orz pandas in the QQ group ACM_XDU-ICPC, each panda have a value IQ, they are all aggressive, An srO panda Ai will beat a Orz panda fixed the follow conditions: Have a smallest IQ among all the pandas whose IQ is higher than or equal to Ai.
There are N Orz pandas numbered from 1 to N (N<=100000) in the QQ group ACM_XDU-ICPC. Today M srO pandas (M<=100000) push into this group, please output the id of Orz pandas who will beaten by Mi srO paddas. If there are multi answer output the minimum id one. No answer output -1.(id is index of input of Orz Pandas. start from 1)
问题 F: Fighting Orz Pandas
时间限制:1000 ms 内存限制:128 MB提交:90 解决:24
[ 提交][ 状态][ 讨论版]
题目描述
输入
Input
Several test cases, process to EOF
First line two number N and M.
Next N lines there are a number in each line. Stand for IQ of Ni Orz panda.
Next M lines there are a number in each line. Stand for IQ of Mi srO panda.
输出
For each case, output M numbers in a line. The number of Orz panda who will beaten by Mi srO
样例输入
3 4 1 2 3 1 2 3 4
样例输出
1 2 3 -1
提示
한국어中文فارسیEnglishไทย
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM