Type: Default 1000ms 256MiB

预算

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

【题目描述】

Lucy家门前的大街上有 nn 家店,lucy是一个喜欢收藏机械键盘的女孩子,这 nn 家店中第 ii 家店卖的键盘价格为 ViV_i ,lucy前前后后有 qq 天心血来潮买电脑,其中第 ii 次买电脑的预算是 KiK_i ,问每一次有多少店的键盘能供lucy选择,能选择当且仅当该店的键盘价格小于等于lucy的预算。

【输入格式】

输入文件第一行两个整数 n,qn,q

接下来一行 nn 个整数,其中第 ii 个整数为 ViV_i

qq 行每行一个整数 KK 代表该次买电脑的预算。

【输出格式】

输出文件 qq 行,第 ii 行表示第 ii 次买电脑,能有多少家店可供选择。

【样例输入】

6 3
6 5 4 3 2 1
1
3
5

【样例输出】

1
3
5

【数据范围】

对于 30%30\% 的数据,n,q1000n,q\leq 1000

对于另外 30%30\% 的数据, n,q100000n,q\leq 1000000Vi,Ki1000000\leq V_i,K_i\leq 100000

对于 100%100\% 的数据, n100000n\leq 100000 , m100000m\leq 100000 , 0Vi,Ki1090\leq V_i,K_i\leq 10^9

2023CSP考前冲刺模拟1

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2023-9-23 8:30
End at
2023-9-23 12:00
Duration
3.5 hour(s)
Host
Partic.
2