fork download
  1. // Problem A : Beautiful Strings
  2.  
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5.  
  6. void solve()
  7. {
  8. int freq[26] = {0};
  9. string s;
  10. cin >> s;
  11. for (int i = 0; i < s.size(); i++)
  12. {
  13. freq[s[i] - 'a']++;
  14. }
  15. bool beautiful = true;
  16. for (int i = 0; i < 26; i++)
  17. {
  18. if (freq[i] % 2 != 0)
  19. {
  20. beautiful = false;
  21. break;
  22. }
  23. }
  24. if (beautiful)
  25. cout << "Yes";
  26. else
  27. cout << "No";
  28. }
  29. int main()
  30. {
  31. int t = 1;
  32. // cin >> t;
  33. while (t--)
  34. {
  35. solve();
  36. }
  37. }
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
Yes