C++,codeforces,1956B,B. Nene and the Card Game

/*
codeforces,1956B,B. Nene and the Card Game
问题描述:
https://codeforces.com/problemset/problem/1956/A
*/
#include <iostream>
#include <vector>
void solve(){
    int n;std::cin>>n;
    std::vector<char> v(n,0);
    int ans = 0;
    for(int i = 0;i<n;++i){
        int temp;std::cin>>temp;
        if(v[temp-1]){
            ++ans;
        }else{
            v[temp-1] = 1;
        }
    }
    std::cout<<ans<<std::endl;
}
int main(){
    int t;std::cin>>t;
    while(t--){
        solve();
    }
}
posted @ 2025-03-07 20:02  Kazuma_124  阅读(13)  评论(0)    收藏  举报