Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;

int main(){
    int N,M,a=0;
    cin >> N >> M;
    vector<string> str1(N+M);
    for(int i=0;i<N+M;i++){
        cin >> str1.at(i);
    }
    for(int i=0;i<N;i++){
        if(a==1)break;
        for(int j=N;j<N+M;j++){
           if(a==1)break;
           if(strstr(str1.at(i),str1.at(j)) != NULL){
               while(j!=M){
                   j++;
                   if(strstr(str1.at(i),str1.at(j)) == NULL){
                        cout << "No";
                        a=1;
                        break;
                   }
               }
           }
       }
    }
    if(a==0)cout << "Yes";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: no matching function for call to 'strstr(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&, __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   18 |            if(strstr(str1.at(i),str1.at(j)) != NULL){
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:4:
/usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |              ^~~~~~
/usr/include/string.h:330:28: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |                      ~~~~~~^~~~~~~~~~
/usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                    ^~~~~~
/usr/include/string.h:332:40: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                            ~~~~~~~~~~~~^~~~~~~~~~
a.cc:21:29: error: no matching function for call to 'strstr(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&, __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   21 |                    if(strstr(str1.at(i),str1.at(j)) == NULL){
      |                       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |              ^~~~~~
/usr/include/string.h:330:28: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
  330 | extern char *strstr (char *__haystack, const char *__needle)
      |                      ~~~~~~^~~~~~~~~~
/usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                    ^~~~~~
/usr/include/string.h:332:40: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
  332 | extern const char *strstr (const char *__haystack, const char *__needle)
      |                            ~~~~~~~~~~~~^~~~~~~~~~