fork download
  1. #include<iostream>
  2. #include<string>
  3. #include<vector>
  4. #include<map>
  5. #include<algorithm>
  6. #include<queue>
  7. #include<fstream>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12. string s;
  13. cin >> s;
  14. int arr[26] = { 0 };
  15. for (int i = 0; i < s.size(); i++)
  16. arr[s[i] - 'a']++;
  17.  
  18. int odd = 0;
  19. for (int i = 0; i < 26; i++)
  20. {
  21. if (arr[i] % 2 == 1)
  22. odd++;
  23. }
  24.  
  25. if (odd > 1)
  26. cout << "NO" << endl;
  27. else
  28. cout << "YES" << endl;
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
YES