Language: C++

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

#define pb push_back
#define fi first
#define se second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int mod = 1e9 + 7;
const int inf = 1e9;

template <class T>
istream& operator>>(istream& ss, vector<T>& v) {
    for (int i = 0; i < v.size(); i++) ss >> v[i];
    return ss;
}

template <class T> 
ostream& operator<<(ostream& ss, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) ss << v[i] << ' ';
    return ss;
}

void solve(){
    string s, t;
    cin >> s >> t;
    if (t.substr(0, s.size()) == s.size()) cout << "Yes";
    else cout << "No";
}

int main(){
    int t = 1;
    //cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
    }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:66:31: error: no match for 'operator==' (operand types are 'std::__cxx11::basic_string<char>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |         ~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~
      |                 |                      |
      |                 |                      std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
      |                 std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/map:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1033 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::pair<_T1, _T2>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  441 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  486 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1667 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1737 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/bits/stl_tree.h:64:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_Tp1>&, const allocator<_T2>&)'
  235 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::allocator<_Tp1>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/bits/stl_map.h:63,
                 from /usr/include/c++/14/map:63:
/usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_Args1 ...>&, const tuple<_Elements ...>&)'
 2558 |     operator==(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::tuple<_Args1 ...>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
/usr/include/c++/14/bits/stl_map.h:1512:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)'
 1512 |     operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1512:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::map<_Key, _Tp, _Compare, _Allocator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/map:64:
/usr/include/c++/14/bits/stl_multimap.h:1134:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator==(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)'
 1134 |     operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multimap.h:1134:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Allocator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/set:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_set.h:987:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator==(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)'
  987 |     operator==(const set<_Key, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:987:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::set<_Key, _Compare, _Allocator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/set:64:
/usr/include/c++/14/bits/stl_multiset.h:973:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator==(const multiset<_Key, _Compare, _Allocator>&, const multiset<_Key, _Compare, _Allocator>&)'
  973 |     operator==(const multiset<_Key, _Compare, _Alloc>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:973:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::multiset<_Key, _Compare, _Allocator>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/list:65,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_list.h:2131:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
 2131 |     operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2131:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::list<_Tp, _Alloc>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_deque.h:2294:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
 2294 |     operator==(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2294:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::deque<_Tp, _Alloc>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/queue:63,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2050:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2050 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2050:5: note:   template argument deduction/substitution failed:
a.cc:66:41: note:   'std::__cxx11::basic_string<char>' is not derived from 'const std::vector<_Tp, _Alloc>'
   66 |     if (t.substr(0, s.size()) == s.size()) cout << "Yes";
      |                                         ^
In file included from /usr/include/c++/14/que