Language: C++

#include"stdio.h"
#include"iostream"
#include"string"
using namespace std;
int main(void){
	int a;
  	int flg = 0;
    cin >> a;
	string b;
	cin >> b;
	string c = b.substr(a/2,a/2);
	if(b.compare(0,a/2,a)==0){
    	flg ==0;
    }else{
    	flg ==1;
    }
	if(flg==0){
    	cout << "No";
    }else{
    	cout << "Yes";
    }
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::compare(int, int, int&)'
   12 |         if(b.compare(0,a/2,a)==0){
      |            ~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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:2:
/usr/include/c++/14/bits/basic_string.h:3428:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _CharT*) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
 3428 |       compare(size_type __pos, size_type __n1, const _CharT* __s) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3428:7: note:   conversion of argument 3 would be ill-formed:
a.cc:12:28: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   12 |         if(b.compare(0,a/2,a)==0){
      |                            ^
      |                            |
      |                            int
/usr/include/c++/14/bits/basic_string.h:3249:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const _Tp&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3249 |         compare(const _Tp& __svt) const
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3249:9: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/basic_string.h:3274:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _Tp&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3274 |         compare(size_type __pos, size_type __n, const _Tp& __svt) const
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3274:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = int]':
/usr/include/c++/14/bits/basic_string.h:149:8:   required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = int; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  149 |         using _If_sv = enable_if_t<
      |               ^~~~~~
/usr/include/c++/14/bits/basic_string.h:3274:2:   required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, int> std::__cxx11::basic_string<char>::compare(size_type, size_type, const _Tp&) const [with _Tp = int]'
 3274 |         compare(size_type __pos, size_type __n, const _Tp& __svt) const
      |         ^~~~~~~
a.cc:12:14:   required from here
   12 |         if(b.compare(0,a/2,a)==0){
      |            ~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, int>'
 2711 |     using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3294:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, int> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _Tp&, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3294 |         compare(size_type __pos1, size_type __n1, const _Tp& __svt,
      |         ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3294:9: note:   candidate expects 4 arguments, 3 provided
/usr/include/c++/14/bits/basic_string.h:3228:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3228 |       compare(const basic_string& __str) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3228:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/basic_string.h:3325:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3325 |       compare(size_type __pos, size_type __n, const basic_string& __str) const
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3325:67: note:   no known conversion for argument 3 from 'int' to 'const std::__cxx11::basic_string<char>&'
 3325 |       compare(size_type __pos, size_type __n, const basic_string& __str) const
      |                                               ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:3362:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3362 |       compare(size_type __pos1, size_type __n1, const basic_string& __str,
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3362:7: note:   candidate expects 5 arguments, 3 provided
/usr/include/c++/14/bits/basic_string.h:3393:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(const _CharT*) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 3393 |       compare(const _CharT* __s) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3393:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/basic_string.h:3467:7: note: candidate: 'int std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::compare(size_type, size_type, const _CharT*, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 3467 |       compare(size_type __pos, size_type __n1, const _CharT* __s,
      |       ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3467:7: note:   candidate expects 4 arguments, 3 provided