Language: C++

#include <bits/stdc++.h>

using namespace std;

#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define pb push_back
#define mk make_pair

typedef long long LL;
typedef pair<int,int> Interval;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){
    os << v.first <<" "<<v.second<<endl;
    return os;
}

struct P{
    int x,y;
    P(int x,int y):x(x),y(y);
};

vector<P> R;
vector<P> L;
vector<P> U;
vector<P> D;
int N;
const int INF = 1e9;

int main()
{
    cin >> N;
    int x,y;
    string s;
    _for(i,0,N){
        cin >> x >> y >> s;
         if(s == "R"){
            R.pb(P(x,y));
        }
         if(s == "L"){
            L.pb(P(x,y));
        }
         if(s == "U"){
            U.pb(P(x,y));
        }
         if(s == "D"){
            D.pb(P(x,y));
        }
    }
    LL xmax = - INF,xmin = INF,ymax = -INF,tmin = INF;

    LL xrmax = -INF,xrmin = INF,xlmax = -INF,xlmin = INF;
    LL yrmax = -INF,yrmin = INF,ylmax = -INF,ylmin = INF;

    _for(i,0,R.size()){
        xrmax = max(xrmax,R[i].x);
        xrmin = min(xrmin,R[i].x);
        ymax = max(ymax,R[i].y);
        ymin = min(ymin,R[i].y);
    }
    _for(i,0,L.size()){
        xlmax = max(xlmax,L[i].x);
        xlmin = min(xlmin,L[i].x);
        ymax = max(ymax,L[i].y);
        ymin = min(ymin,L[i].y);
    }

    _for(i,0,U.size()){
        yrmax = max(yrmax,U[i].y);
        yrmin = min(yrmin,U[i].y);
        xmax = max(xmax,U[i].x);
        xmin = min(xmin,U[i].x);
    }
    _for(i,0,D.size()){
        ylmax = max(ylmax,D[i].y);
        ylrmin = min(ylmin,D[i].y);
        xmax = max(xmax,D[i].x);
        xmin = min(xmin,D[i].x);
    }

    LL befx = INF;
    LL befy = INF;
    LL ans = befx*befy;

    while(true){
        LL xx = max(xlmax-t,max(xrmax+t,xmax)) - min(min(xmin,xlmin-t),xrmin+t);
        LL yy = max(ylmax-t,max(yrmax+t,ymax)) - min(min(ymin,ylmin-t),yrmin+t);
        ans = min(ans,xx*yy);
        if(xx > befx && yy > befy) break;
        befx = xx;
        befy = yy;
    }
    cout << ans << endl;


    return 0;
}


Compiler output:
a.cc: In constructor 'P::P(int, int)':
a.cc:35:29: error: expected '{' at end of input
   35 |     P(int x,int y):x(x),y(y);
      |                             ^
a.cc: In function 'int main()':
a.cc:71:20: error: no matching function for call to 'max(LL&, int&)'
   71 |         xrmax = max(xrmax,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:71:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   71 |         xrmax = max(xrmax,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:71:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   71 |         xrmax = max(xrmax,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
a.cc:72:20: error: no matching function for call to 'min(LL&, int&)'
   72 |         xrmin = min(xrmin,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/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:   template argument deduction/substitution failed:
a.cc:72:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   72 |         xrmin = min(xrmin,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/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, 2 provided
/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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:72:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   72 |         xrmin = min(xrmin,R[i].x);
      |                 ~~~^~~~~~~~~~~~~~
a.cc:73:19: error: no matching function for call to 'max(LL&, int&)'
   73 |         ymax = max(ymax,R[i].y);
      |                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:73:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   73 |         ymax = max(ymax,R[i].y);
      |                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:73:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   73 |         ymax = max(ymax,R[i].y);
      |                ~~~^~~~~~~~~~~~~
a.cc:74:9: error: 'ymin' was not declared in this scope; did you mean 'ylmin'?
   74 |         ymin = min(ymin,R[i].y);
      |         ^~~~
      |         ylmin
a.cc:77:20: error: no matching function for call to 'max(LL&, int&)'
   77 |         xlmax = max(xlmax,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:77:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   77 |         xlmax = max(xlmax,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:77:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   77 |         xlmax = max(xlmax,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
a.cc:78:20: error: no matching function for call to 'min(LL&, int&)'
   78 |         xlmin = min(xlmin,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/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:   template argument deduction/substitution failed:
a.cc:78:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   78 |         xlmin = min(xlmin,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
/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, 2 provided
/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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:78:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   78 |         xlmin = min(xlmin,L[i].x);
      |                 ~~~^~~~~~~~~~~~~~
a.cc:79:19: error: no matching function for call to 'max(LL&, int&)'
   79 |         ymax = max(ymax,L[i].y);
      |                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:79:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   79 |         ymax = max(ymax,L[i].y);
      |                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compar