Language: C++

#include <iostream>
#include <cstring>

using namespace std;

typedef long long ll;

int a[200005];
int dp[1 << 26];
const ll INF = 1e17;

int main() {
  string s;
  cin >> s;

  for(int i = 0; i < s.size(); i++) {
    a[i+1] = (1ll << (s[i] - 'a')) ^ a[i];
    //  cout << a[i+1] << endl;
  }

  for(int i = 0; i < (1 << 26); i++) dp[i] = INF;

  dp[0] = 0;

  ll tmp;
  for(int i = 1; i <= s.size(); i++) {
    tmp = dp[a[i]];
    for(int j = 0; j < 26; j++) {
      ll s = (1ll << j);
      tmp = min(tmp,dp[a[i] ^ s]);
    }
    dp[a[i]] = min(dp[a[i]],tmp + 1);
    //  cout << a[i] <<"   "<<dp[a[i]] << endl;
  }
  cout << tmp + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:46: warning: overflow in conversion from 'll' {aka 'long long int'} to 'int' changes value from '100000000000000000' to '1569325056' [-Woverflow]
   21 |   for(int i = 0; i < (1 << 26); i++) dp[i] = INF;
      |                                              ^~~
a.cc:30:16: error: no matching function for call to 'min(ll&, int&)'
   30 |       tmp = min(tmp,dp[a[i] ^ s]);
      |             ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:30:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   30 |       tmp = min(tmp,dp[a[i] ^ s]);
      |             ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
a.cc:32:19: error: no matching function for call to 'min(int&, ll)'
   32 |     dp[a[i]] = min(dp[a[i]],tmp + 1);
      |                ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:32:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   32 |     dp[a[i]] = min(dp[a[i]],tmp + 1);
      |                ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided