Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define ff first
- #define ss second
- #define pb push_back
- int main()
- {
- _test
- {
- int n;
- cin >> n;
- map <int, int> cnt;
- for(int i = 0; i < n; i++) {
- int x;
- cin >> x;
- cnt[x] += 1;
- }
- int ans = 0;
- for(auto [x, freq] : cnt) {
- if(freq > 1) {
- ++ans;
- }
- }
- cout << ans << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement