Language: C++

#include <vector>
#include <algorithm>

using namespace std;

double g(const int n, const vector<double> x, const vector<double> y, const vector<string> d, const double t) {
    double x_min = *max_element(x.begin(), x.end());
    double x_max = *min_element(x.begin(), x.end());
    double y_min = *max_element(y.begin(), y.end());
    double y_max = *min_element(y.begin(), y.end());
    for (int i=0; i < n; ++i) {
        int vx = 0;
        int vy = 0;
        if (d[i] == "R")        vx = 1;
        else if (d[i] == "L")   vx = -1;
        else if (d[i] == "U")   vy = 1;
        else if (d[i] == "D")   vy = -1;
        double nx = x[i] + vx * t;
        double ny = y[i] + vy * t;
        x_min = min(x_min, nx);
        x_max = max(x_max, nx);
        y_min = min(y_min, ny);
        y_max = max(y_max, ny);
    }
    return (x_max - x_min) * (y_max - y_min);
}

double solve(const int n, const vector<double> x, const vector<double> y, const vector<string> d) {
    double lb = 0;
    double ub = 1LL << 60;
    while (abs(ub-lb) > 1e-9) {
        double t1 = (2*lb + ub) / 3.0;
        double t2 = (lb + 2*ub) / 3.0;
        double h1 = g(n, x, y, d, t1);
        double h2 = g(n, x, y, d, t2);
        if (h1 < h2) {
            ub = t2;
        } else {
            lb = t1;
        }
    }
    double t = (lb + ub) / 2.0;
    return g(n, x, y, d, t);
}

int main() {
    int n; cin >> n;
    vector<double> x(n), y(n);
    vector<string> d(n);
    for (int i=0; i < n; ++i) {
        cin >> x[i] >> y[i] >> d[i];
    }
    cout << solve(n, x, y, d) << endl;
}

Compiler output:
a.cc:6:84: error: 'string' was not declared in this scope
    6 | double g(const int n, const vector<double> x, const vector<double> y, const vector<string> d, const double t) {
      |                                                                                    ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <algorithm>
  +++ |+#include <string>
    3 | 
a.cc:6:90: error: template argument 1 is invalid
    6 | double g(const int n, const vector<double> x, const vector<double> y, const vector<string> d, const double t) {
      |                                                                                          ^
a.cc:6:90: error: template argument 2 is invalid
a.cc: In function 'double g(int, std::vector<double>, std::vector<double>, int, double)':
a.cc:14:14: error: invalid types 'const int[int]' for array subscript
   14 |         if (d[i] == "R")        vx = 1;
      |              ^
a.cc:15:19: error: invalid types 'const int[int]' for array subscript
   15 |         else if (d[i] == "L")   vx = -1;
      |                   ^
a.cc:16:19: error: invalid types 'const int[int]' for array subscript
   16 |         else if (d[i] == "U")   vy = 1;
      |                   ^
a.cc:17:19: error: invalid types 'const int[int]' for array subscript
   17 |         else if (d[i] == "D")   vy = -1;
      |                   ^
a.cc: At global scope:
a.cc:28:88: error: 'string' was not declared in this scope
   28 | double solve(const int n, const vector<double> x, const vector<double> y, const vector<string> d) {
      |                                                                                        ^~~~~~
a.cc:28:88: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:28:94: error: template argument 1 is invalid
   28 | double solve(const int n, const vector<double> x, const vector<double> y, const vector<string> d) {
      |                                                                                              ^
a.cc:28:94: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:47:12: error: 'cin' was not declared in this scope
   47 |     int n; cin >> n;
      |            ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | 
a.cc:49:12: error: 'string' was not declared in this scope
   49 |     vector<string> d(n);
      |            ^~~~~~
a.cc:49:12: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:49:18: error: template argument 1 is invalid
   49 |     vector<string> d(n);
      |                  ^
a.cc:49:18: error: template argument 2 is invalid
a.cc:51:33: error: invalid types 'int[int]' for array subscript
   51 |         cin >> x[i] >> y[i] >> d[i];
      |                                 ^
a.cc:53:5: error: 'cout' was not declared in this scope
   53 |     cout << solve(n, x, y, d) << endl;
      |     ^~~~
a.cc:53:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:34: error: 'endl' was not declared in this scope
   53 |     cout << solve(n, x, y, d) << endl;
      |                                  ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 |