Language: C++

#include<bits/stdc++.h>
using namespace std;
///------------input------------//
#define fi freopen("in.txt","r",stdin)
#define fo freopen("out.txt","w",stdout)
#define sc1(a) scanf("%lld",&a)
#define sc3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define sc2(a,b) scanf("%lld%lld",&a,&b)
#define scar(arr,n) for(int index=0;index<n;index++)sc1(arr[index]);
 
///------------Vector------------///
 
#define vs vector<string>
#define vll vector<long long int >
#define vc vector<char>
#define vpll vector<pair<long long,long long>>
#define vvll vector<vector<long long>>
#define up(v,x) upper_bound(v.begin(),v.end(),x)-v.begin()
#define low(v,x) lower_bound(v.begin(),v.end(),x)-v.begin()
#define ALL(a) (a).begin(),(a).end()
 
///-------------LOOP--------------///
 
#define foreach(i,a) for(__typeof((a).begin()) i = (a).begin(); i != (a).end(); ++i)
#define cases ll t,ti=0;cin>>t;while((ti++)!=t)
#define fr(i,a,n) for(i = (a); i < (n); i++)
#define fri(i,a,n) for(i = (a); i <= (n); i++)
 
///------------limite------------///
#define eps 1e-13
#define mod 1000000007LL
#define PI acos(-1)
#define INF 1000000011
 
///------------PAIR------------///
 
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mk make_pair
#define ff first
#define ss second
 
///------------Extra------------///
 
#define clc clock_t time_req=clock()
#define pclc cout<<setprecision(10)<<(float)time_req/CLOCKS_PER_SEC
#define ll long long int
#define nl printf("\n")
#define qll queue<long long int >
#define mll map<long long int , long long int>
#define pb(x) push_back(x)
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define sws ios_base::sync_with_stdio(false); cin.tie(0)
#define mst(x) memset(x,0,sizeof(x))
#define Log(x,a) (log(a)/log(x))
#define PNY(f,a) printf((f==a)?"NO\n":"YES\n");
#define PYN(f,a) printf((f==a)?"YES\n":"NO\n");
bool CMP(int a, int b) { return a>b; }
ll p=1e9+7;
ll power(ll x, ll y)
{
    ll res = 1;     // Initialize result
 
    x = x % p; // Update x if it is more than or
                // equal to p
 
    if (x == 0) return 0; // In case x is divisible by p;
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;
 
        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
ll cnt=0,cnt1=0;
vector<vector<ll> >adj(200010);
ll vis[310068],last[10000],last1[10000];
vector<ll> viso;
bool ok=false;
void dfs(ll k,ll parent)
{
    //cout<<1<<endl;
 
    if(vis[k]==1)
        return;
    vis[k]=true;
    if(adj[k].size()!=2)
        ok=false;
    for(ll j=0;j<adj[k].size();j++)
    {
        if(adj[k][j]==parent)
            continue;
        dfs(adj[k][j],k);
    }
 
    //cout<<4<<endl;
}
#define PI 3.14159265
 ll dp[200010];
bool mycompare(string s,string t)
{
    string x=s+t;
    string y=t+s;
    if(x>y)
        return 1;
    else
        return 0;
}
 
vector<string> v1;
ll maxi=1e7;
set<ll>w;
//vector<ll>adj(200010);
int main()
{
    string s,t;
    cin>>s>>t;
    ll n=s.length(),m=t.length(),i;
    for(i=0;i<n;i++)
    {
        if(s[i]!=t[i])
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    if(m==t+1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}

Compiler output:
a.cc:109:9: warning: "PI" redefined
  109 | #define PI 3.14159265
      |         ^~
a.cc:32:9: note: this is the location of the previous definition
   32 | #define PI acos(-1)
      |         ^~
a.cc: In function 'int main()':
a.cc:138:12: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
  138 |     if(m==t+1)
      |           ~^~
      |           | |
      |           | int
      |           std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
  627 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
 1798 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
  138 |     if(m==t+1)
      |             ^
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:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3598 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3616 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3635 |     operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
 3652 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const _CharT*' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   deduced conflicting types for parameter '_CharT' ('char' and 'int')
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3682 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 3689 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 3696 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 3719 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 3726 |     operator+(_CharT __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
 3733 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   mismatched types 'const _CharT*' and 'int'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
 3740 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3740:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   deduced conflicting types for parameter '_CharT' ('char' and 'int')
  138 |     if(m==t+1)
      |             ^
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)'
  340 |     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:340:5: note:   template argument deduction/substitution failed:
a.cc:138:13: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
  138 |     if(m==t+1)
      |             ^
/usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp&)'
  349 |     operator+(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:349