mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-14 04:58:49 +00:00
22 lines
359 B
C++
22 lines
359 B
C++
#include <iostream>
|
|
#include <algorithm>
|
|
|
|
using std::cin;
|
|
using std::cout;
|
|
using std::endl;
|
|
|
|
int n, q, x, a[200005];
|
|
|
|
int main() {
|
|
cin >> n >> q;
|
|
for (int i = 0; i < n; i++) {
|
|
cin >> a[i];
|
|
}
|
|
std::sort(a, a + n);
|
|
while (q--) {
|
|
cin >> x;
|
|
cout << n - (std::lower_bound(a, a + n, x) - a) << endl;
|
|
}
|
|
return 0;
|
|
}
|