0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

C - Counting 2

https://atcoder.jp/contests/abc231/submissions/27825427
This commit is contained in:
Baoshuo Ren 2021-12-11 20:11:29 +08:00
parent f50c87b73c
commit 5d732a877f
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

21
AtCoder/ABC231/C/C.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <algorithm>
#include <iostream>
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;
}