Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 

using namespace __gnu_pbds;
using namespace std;

// MACROS

#define ll long long
#define ull unsigned long long
#define ld long double

#define vi vector<int>
#define vll vector<ll>
#define vld vector<ld>
#define u_s unordered_set

#define pii pair<int,int>
#define pll pair<ll,ll>

#define FOR(i, n) for (ll (i) = 0; i < n; i++)
#define FORN(i, a, b) for (ll (i) = a; i < b; i++)
#define FORE(i, l) for (auto (i) : l)

#define pb push_back
#define pob pop_back
#define emp emplace
#define fi first
#define se second

#define all(n) (n).begin(), (n).end()
#define in(n) cin >> (n);
#define debug(n) cout << #n << ": " << n << '\n';

// FUNCTIONS

template< typename T >
inline T gcd(T a, T b) { if (b) return gcd(b, a % b); return a; }

template< typename T >
inline T ext_gcd(T a, T b, T & x, T & y) { if (a == 0) { x = 0; y = 1; return b; } T x1, y1; T g = ext_gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return g; }

bool pal(string s)
{
    string rev = string(s);
    reverse(all(rev));
    return s == rev;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);	
    //cout << setprecision(15);
    string s;
    cin >> s;    
    ll n = s.size();
    //cout << s.substr(0, (n - 1) / 2) << " " << s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) << '\n';
    cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
}



Compiler output:
a.cc: In function 'int main()':
a.cc:59:98: error: no match for 'operator&&' (operand types are 'std::__cxx11::basic_string<char>' and 'bool')
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~
      |                                                           |                                            |
      |                                                           std::__cxx11::basic_string<char>             bool
a.cc:59:98: note: candidate: 'operator&&(bool, bool)' (built-in)
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
a.cc:59:98: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'bool'
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  415 |     _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:415:5: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  415 |     _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:415:5: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  415 |     _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:415:5: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  415 |     _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:415:5: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  415 |     _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:415:5: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const valarray<_Tp>&)'
 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1206:1: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1206:1: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::valarray<_Tp>'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^
/usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1206:1: note:   template argument deduction/substitution failed:
a.cc:59:106: note:   mismatched types 'const std::valarray<_Tp>' and 'bool'
   59 |     cout << (pal(s.substr(0, (n - 1) / 2)) && pal(s.substr((n + 3) / 2 - 1, n - (n + 3) / 2 + 1) && pal(s)) ? "Yes\n" : "No\n");
      |                                                                                                          ^