Language: C++

#include "bits/stdc++.h"
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long int
#define int ll
// #define double long double
//#define slld(t) scanf("%lld",&t)
//#define sd(t) scanf("%d",&t)
//#define pd(t) printf("%d\n",t)
//#define plld(t) printf("%lld\n",t)
#define vec vector < int >
#define vecp vector < pair < int , int > >
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define pii pair < int , int >
#define pll pair < ll , ll > 
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define mod  1000000007
#define N   2005
#define MAX 300005
#define mod1 1000000007
#define mod2 998244353
#define bitcnt __builtin_popcountll
#define PI acos(-1)
//#define endl "\n"
#define inf 1e+15
char d[N];
double x[N],y[N];
int n;
long double f(long double t){
	long double xmax = -1e+12 , xmin=1e+12 , ymax=-1e+12 , ymin=1e+12;
	for(int i=0;i<n;i++){
		if(d[i]=='L') xmin=min(xmin,x[i]-t) , xmax=max(xmax,x[i]-t);
		else if(d[i]=='R') xmin=min(xmin,x[i]+t),xmax=max(xmax,x[i]+t);
		else
			xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
	}
	for(int i=0;i<n;i++){
		if(d[i]=='D') ymin=min(ymin,y[i]-t) , ymax=max(ymax,y[i]-t);
		else if(d[i]=='U') ymin=min(ymin,y[i]+t),ymax=max(ymax,y[i]+t);
		else
			ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
	}
	return (xmax-xmin)*(ymax-ymin);

}
signed main(){
  fast;
  cin>>n;
  for(int i=0;i<n;i++) cin>>x[i]>>y[i]>>d[i];

  long double l = 0 , r = 1e+9,md1,md2;
  for(int j=1;j<=1000;j++){
  	  md1=l+(r-l)/3 , md2= l+(r-l)*2/3;
  	  if(f(md1)<=f(md2)) r=md2;
  	  else l = md1;
  }
  cout<<fixed<<setprecision(12)<<f(md1)<<endl;
}
  


Compiler output:
a.cc: In function 'long double f(long double)':
a.cc:39:33: error: no matching function for call to 'max(long double&, double&)'
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                              ~~~^~~~~~~~~~~
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:39:33: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                              ~~~^~~~~~~~~~~
/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:39:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                              ~~~^~~~~~~~~~~
a.cc:39:53: error: no matching function for call to 'min(long double&, double&)'
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                                                  ~~~^~~~~~~~~~~
/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:39:53: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                                                  ~~~^~~~~~~~~~~
/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:39:53: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   39 |                         xmax=max(xmax,x[i]),xmin=min(xmin,x[i]);
      |                                                  ~~~^~~~~~~~~~~
a.cc:45:33: error: no matching function for call to 'max(long double&, double&)'
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                              ~~~^~~~~~~~~~~
/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:45:33: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                              ~~~^~~~~~~~~~~
/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:45:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                              ~~~^~~~~~~~~~~
a.cc:45:53: error: no matching function for call to 'min(long double&, double&)'
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                                                  ~~~^~~~~~~~~~~
/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:45:53: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                                                  ~~~^~~~~~~~~~~
/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:45:53: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   45 |                         ymax=max(ymax,y[i]),ymin=min(ymin,y[i]);
      |                                                  ~~~^~~~~~~~~~~