Language: C++

#include <bits/stdc++.h>

int main() {
  std::string s; std::cin >> s;
  int l = s.size();
  std::string rs(s.rbegin(), s.rend());
  bool is_palindrome = true;
  if (s != rs) is_palindrome = false;
  
  std::string sub_s1 = s.substr(s.begin(), s.begin()+(l-1)/2);
  std::string sub_rs1 = rs.substr(rs.begin()+(l+1)/2, rs.end());
  if (sub_s1 != sub_rs1) is_palindrom = false;
  
  std::string sub_s2 = s.substr(s.begin()+(l+1)/2, s.end());
  std::string sub_rs2 = rs.substr(rs.begin(), rs.begin()+(l-1)/2);
  if (sub_s2 != sub_rs2) is_palindrom = false;
  
  if (is_palindrom) std::cout << "Yes" << std::endl;
  else std::cout << "No" << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   10 |   std::string sub_s1 = s.substr(s.begin(), s.begin()+(l-1)/2);
      |                                 ~~~~~~~^~
      |                                        |
      |                                        std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
a.cc:11:45: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   11 |   std::string sub_rs1 = rs.substr(rs.begin()+(l+1)/2, rs.end());
      |                                   ~~~~~~~~~~^~~~~~~~
      |                                             |
      |                                             __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >
/usr/include/c++/14/bits/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
a.cc:12:26: error: 'is_palindrom' was not declared in this scope; did you mean 'is_palindrome'?
   12 |   if (sub_s1 != sub_rs1) is_palindrom = false;
      |                          ^~~~~~~~~~~~
      |                          is_palindrome
a.cc:14:42: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   14 |   std::string sub_s2 = s.substr(s.begin()+(l+1)/2, s.end());
      |                                 ~~~~~~~~~^~~~~~~~
      |                                          |
      |                                          __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >
/usr/include/c++/14/bits/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
a.cc:15:43: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
   15 |   std::string sub_rs2 = rs.substr(rs.begin(), rs.begin()+(l-1)/2);
      |                                   ~~~~~~~~^~
      |                                           |
      |                                           std::__cxx11::basic_string<char>::iterator
/usr/include/c++/14/bits/basic_string.h:3208:24: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |              ~~~~~~~~~~^~~~~~~~~
a.cc:16:26: error: 'is_palindrom' was not declared in this scope; did you mean 'is_palindrome'?
   16 |   if (sub_s2 != sub_rs2) is_palindrom = false;
      |                          ^~~~~~~~~~~~
      |                          is_palindrome
a.cc:18:7: error: 'is_palindrom' was not declared in this scope; did you mean 'is_palindrome'?
   18 |   if (is_palindrom) std::cout << "Yes" << std::endl;
      |       ^~~~~~~~~~~~
      |       is_palindrome