fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--){
  8. map<int,int> m;
  9. int n;
  10. cin >> n;
  11. for(int i=0;i<n;i++){
  12. int num;
  13. cin >> num;
  14. m[num]++;
  15. }
  16. int odd_count = 0;
  17. for(auto pr : m){
  18. if(pr.second % 2 != 0){
  19. odd_count++;
  20. }
  21. }
  22. if(odd_count)
  23. cout << "yes\n";
  24. else
  25. cout << "no\n";
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0s 5284KB
stdin
5
2
2 1
2
1 1
3
3 3 3
4
3 3 4 4
4
1 2 2 2
stdout
yes
no
yes
no
yes