Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n , q , k;
- cin >> n >> q;
- int a[n + 2];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- sort(a , a + n);
- while(q--){
- cin >> k;
- int ans = upper_bound(a , a + n , k) - lower_bound(a , a + n , k);
- cout << ans << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement