Language: C++

#include<bits/stdc++.h>
#include <sstream>
#define ll long long
using namespace std;

int main(){
   bool b=false;

   int sz;
   string s1,s2;
   cin>>s1>>s2;
   deque<char> s1_dq(s1, end(s1));
   deque<char> s2_dq(s2, end(s2)); 
   sz=s1.size();
   for(int i=0;i<sz;i++){
        for(int j=i;j<sz+i;j++){
            if(s1_dq[i]==s2_dq[j]){
                cout<<"Yes"<<endl;
                b=true;
                break;
        }
   }

   if(b=false)cout<<"No"<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: no matching function for call to 'std::deque<char>::deque(std::string&, std::__cxx11::basic_string<char>::iterator)'
   12 |    deque<char> s1_dq(s1, end(s1));
      |                                 ^
In file included from /usr/include/c++/14/deque:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:139,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_deque.h:1003:9: note: candidate: 'template<class _InputIterator, class> std::deque<_Tp, _Alloc>::deque(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = char; _Alloc = std::allocator<char>]'
 1003 |         deque(_InputIterator __first, _InputIterator __last,
      |         ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1003:9: note:   template argument deduction/substitution failed:
a.cc:12:33: note:   deduced conflicting types for parameter '_InputIterator' ('std::__cxx11::basic_string<char>' and '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >')
   12 |    deque<char> s1_dq(s1, end(s1));
      |                                 ^
/usr/include/c++/14/bits/stl_deque.h:976:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
  976 |       deque(initializer_list<value_type> __l,
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:976:42: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<char>'
  976 |       deque(initializer_list<value_type> __l,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:952:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::false_type = std::false_type]'
  952 |       deque(deque&& __x, const allocator_type& __a, false_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:952:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_deque.h:948:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::true_type = std::true_type]'
  948 |       deque(deque&& __x, const allocator_type& __a, true_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:948:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_deque.h:943:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
  943 |       deque(deque&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:943:21: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>&&'
  943 |       deque(deque&& __x, const __type_identity_t<allocator_type>& __a)
      |             ~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:936:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(const std::deque<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
  936 |       deque(const deque& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:936:26: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::deque<char>&'
  936 |       deque(const deque& __x, const __type_identity_t<allocator_type>& __a)
      |             ~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:933:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&) [with _Tp = char; _Alloc = std::allocator<char>]'
  933 |       deque(deque&&) = default;
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:933:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_deque.h:917:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(const std::deque<_Tp, _Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>]'
  917 |       deque(const deque& __x)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:917:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_deque.h:890:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(size_type, const value_type&, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; value_type = char; allocator_type = std::allocator<char>]'
  890 |       deque(size_type __n, const value_type& __value,
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:890:23: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::size_type' {aka 'long unsigned int'}
  890 |       deque(size_type __n, const value_type& __value,
      |             ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:878:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(size_type, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; allocator_type = std::allocator<char>]'
  878 |       deque(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:878:23: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>::size_type' {aka 'long unsigned int'}
  878 |       deque(size_type __n, const allocator_type& __a = allocator_type())
      |             ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:865:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
  865 |       deque(const allocator_type& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:865:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_deque.h:855:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque() [with _Tp = char; _Alloc = std::allocator<char>]'
  855 |       deque() = default;
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:855:7: note:   candidate expects 0 arguments, 2 provided
a.cc:13:33: error: no matching function for call to 'std::deque<char>::deque(std::string&, std::__cxx11::basic_string<char>::iterator)'
   13 |    deque<char> s2_dq(s2, end(s2));
      |                                 ^
/usr/include/c++/14/bits/stl_deque.h:1003:9: note: candidate: 'template<class _InputIterator, class> std::deque<_Tp, _Alloc>::deque(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = char; _Alloc = std::allocator<char>]'
 1003 |         deque(_InputIterator __first, _InputIterator __last,
      |         ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1003:9: note:   template argument deduction/substitution failed:
a.cc:13:33: note:   deduced conflicting types for parameter '_InputIterator' ('std::__cxx11::basic_string<char>' and '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >')
   13 |    deque<char> s2_dq(s2, end(s2));
      |                                 ^
/usr/include/c++/14/bits/stl_deque.h:976:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
  976 |       deque(initializer_list<value_type> __l,
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:976:42: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<char>'
  976 |       deque(initializer_list<value_type> __l,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:952:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::false_type = std::false_type]'
  952 |       deque(deque&& __x, const allocator_type& __a, false_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:952:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_deque.h:948:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::true_type = std::true_type]'
  948 |       deque(deque&& __x, const allocator_type& __a, true_type)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:948:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_deque.h:943:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(std::deque<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
  943 |       deque(deque&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:943:21: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::deque<char>&&'
  943 |       deque(deque&& __x, const __type_identity_t<allocator_type>& __a)
      |             ~~~~~~~~^~~
/usr/include/c++/14/bits/stl_deque.h:936:7: note: candidate: 'std::deque<_Tp, _Alloc>::deque(const std::deque<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
  936 |       deque(const deque& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:936:26: note:   no known conversion for argument 1 f