Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define endl '\n'
- int main(){
- int t;
- cin>>t;
- while(t--){
- int n;
- cin>>n;
- unordered_map<int,int>mp;
- for(int i=0; i<n; i++){
- int val;
- cin>>val;
- mp[val] ^= 1;
- }
- int ans = 0;
- for(auto entry: mp){
- ans += entry.second;
- }
- ans += (4*((n+ans)/4+1)-(n+ans))%4;
- cout<<ans<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement