Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	vector<tuple<int,int,char>> in;
	vector<vi> yoko(3), tate(3);
	
	rep(i, n){
		int x, y; char d;
		cin >> x >> y >> d;
		in.emplace_back(x, y, d);
		
		if(d == 'L' || d == 'R'){
			if(d == 'L') yoko[0].pb(x);
			if(d == 'R') yoko[2].pb(x);
			tate[1].pb(y);
		}
		else{
			if(d == 'U') tate[2].pb(y);
			if(d == 'D') tate[0].pb(y);
			yoko[1].pb(x);
		}
	}
	
	vi ev;
	auto func = [](vi &l, vi &s, vi &r, vi &ev){
		sort(all(l)); sort(all(s)); sort(all(r));
		// max change
		int a = l.size() ? l.back() : inf;
		int b = s.size() ? s.back() : inf;
		int c = r.size() ? r.back() : inf;
		if(a < inf && b < inf) ev.pb((a - b) * 2);
		if(a < inf && c < inf) ev.pb(a - c);
		if(b < inf && c < inf) ev.pb((b - c) * 2);
		
		// min change
		a = l.size() ? l[0] : inf;
		b = s.size() ? s[0] : inf;
		c = r.size() ? r[0] : inf;
		if(a < inf && b < inf) ev.pb((a - b) * 2);
		if(a < inf && c < inf) ev.pb(a - c);
		if(b < inf && c < inf) ev.pb((b - c) * 2);
	};
	func(yoko[0], yoko[1], yoko[2], ev);
	func(tate[0], tate[1], tate[2], ev);
	
	{
		ev.pb(0); ev.pb(6e8);
		sort(all(ev)); ev.erase(unique(all(ev)), ev.end());
		vi t;
		for(int i : ev) if(i >= 0) t.pb(i);
		ev = t;
	}
	
	//dbg(ev);dbg(yoko);dbg(tate);
	
	auto calc = [&](double t){
		double x = inf, X = -inf, y = inf, Y = -inf;
		for(auto p : in){
			double a, b; char c; tie(a, b, c) = p;
			a *= 2; b *= 2;
			if(c == 'U') b += t;
			if(c == 'D') b -= t;
			if(c == 'R') a += t;
			if(c == 'L') a -= t;
			x = min(x, a); X = max(X, a);
			y = min(y, b); Y = max(Y, b);
		}
		return (X - x) * (Y - y) / 4;
	};
	
	double ans = 1e18;
	rep(i, ev.size() - 1){
		double l, r, lo = ev[i], hi = ev[i + 1];
		rep(it, 100){
			l = (lo * 2 + hi) / 3;
			r = (lo + hi * 2) / 3;
			
			if(calc(l) < calc(r)) hi = r;
			else lo = l;
		}
		ans = min(ans, ev[i]);
		ans = min(ans, calc((lo + hi) / 2));
	}
	ll ansi = (ll)(ans * 4 + 0.5);
	assert(abs(ansi - ans * 4) < 1e-5);
	
	if(ansi % 4 == 0) cout << ansi / 4 << endl;
	else cout << ansi / 4.0 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:96:26: error: no matching function for call to 'min(double&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   96 |                 ans = min(ans, ev[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: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:96:26: note:   deduced conflicting types for parameter 'const _Tp' ('double' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   96 |                 ans = min(ans, ev[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
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:   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:96:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   96 |                 ans = min(ans, ev[i]);
      |                       ~~~^~~~~~~~~~~~