Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int H,W,N,X,Y; cin>>H>>W>>N>>X>>Y;
  string S,T; cin>>S>>T;
  string ans="YES";
  int memo=X;
  rep(i,0,N){
    if(S[i]=='R') memo++;
    if(W<memo) ans="NO";
    if(T[i]=='L') memo=max(memo-1.1ll);
  }
  memo=X;
  rep(i,0,N){
    if(S[i]=='L') memo--;
    if(memo<1) ans="NO";
    if(T[i]=='R') memo=min(memo+1.W);
  }
  memo=Y;
  rep(i,0,N){
    if(S[i]=='U') memo--;
    if(memo<1) ans="NO";
    if(T[i]=='D') memo=min(memo+1.H);
  }
  memo=Y;
  rep(i,0,N){
    if(S[i]=='D') memo++;
    if(H<memo) ans="NO";
    if(T[i]=='U') memo=max(memo-1.1ll);
  }
  cout<<ans<<endl;
  }



Compiler output:
a.cc: In function 'int main()':
a.cc:27:33: error: unable to find numeric literal operator 'operator""ll'
   27 |     if(T[i]=='L') memo=max(memo-1.1ll);
      |                                 ^~~~~
a.cc:33:27: error: no matching function for call to 'min(long double)'
   33 |     if(T[i]=='R') memo=min(memo+1.W);
      |                        ~~~^~~~~~~~~~
In file included 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_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:33:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   33 |     if(T[i]=='R') memo=min(memo+1.W);
      |                        ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
a.cc:39:33: error: unable to find numeric literal operator 'operator""H'
   39 |     if(T[i]=='D') memo=min(memo+1.H);
      |                                 ^~~
a.cc:45:33: error: unable to find numeric literal operator 'operator""ll'
   45 |     if(T[i]=='U') memo=max(memo-1.1ll);
      |                                 ^~~~~