murugappan_s

STRSRCH - Editorial

Oct 14th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define ll long long
  3. #define ld long double
  4. #define pb push_back
  5. #define x first
  6. #define y second
  7. #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  8. #define PI (atan(1)*4)
  9. #define mp make_pair
  10. using namespace std;
  11. int freq[26], ans;
  12. string s;
  13. int main()
  14. {
  15.     fastread;
  16.     cin >> s;
  17.     for (int i = 0; i < s.size(); i++)
  18.         freq[s[i] - 'a'] ^= 1;
  19.     for (int i = 0; i < 26; i++)
  20.         ans += freq[i];
  21.     cout << ans / 2;
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment