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