Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

struct node {
  vector<char> v;
  int mx, my, Mx, My;
  node(vector<char v>, int mx, int my, int Mx, int My):
    v(v), mx(mx), my(mx), Mx(Mx), My(My) {}
};

map<char, node> G;

int field[50 + 2][50 + 2];

int main()
{
  int numberOfInput;
  scanf("%d ", &numberOfInput);
  for (int caseIndex = 0; caseIndex < numberOfInput; caseIndex++) {
    int H, W;
    scanf("%d %d ", &H, &W);
    for (int i = 0; i < H; i++) {
      fill(field[i], &field[i][52], '.');
    }
    for (int i = 1; i <= H; i++) {
      for (int j = 1; j <= W; j++) {
	scanf("%c ", &field[i][j]);
	if (field[i][j] != '.') {
	  G[ field[i][j] ] = node(vector<int>(), 0, 0, 
				  0, 0, field[i][j]);
	}
      }
    }
    
    for (map<char, node>::iterator it = G.begin(); 
	 it != G.end(); it++) {
      char c = it->first;
      int mx = 50, my = 50, Mx = -1, My = -1;
      for (int i = 1; i <= H; i++) {
	for (int j = 1; j <= W; j++) {
	  if (field[i][j] == c) {
	    mx = min(mx, j);
	    my = min(my, i);
	    Mx = max(Mx, j);
	    My = max(My, i);
	  }
	}
      }
      G[c] = node(vector<int>(), mx, my, Mx, My, c);
    }
  }
}

Compiler output:
a.cc:10:21: error: template argument 1 is invalid
   10 |   node(vector<char v>, int mx, int my, int Mx, int My):
      |                     ^
a.cc:10:21: error: template argument 2 is invalid
a.cc:14:1: error: 'map' does not name a type
   14 | map<char, node> G;
      | ^~~
a.cc: In function 'int main()':
a.cc:32:11: error: 'G' was not declared in this scope
   32 |           G[ field[i][j] ] = node(vector<int>(), 0, 0,
      |           ^
a.cc:33:52: error: no matching function for call to 'node::node(std::vector<int>, int, int, int, int, int&)'
   33 |                                   0, 0, field[i][j]);
      |                                                    ^
a.cc:10:3: note: candidate: 'node::node(int, int, int, int, int)'
   10 |   node(vector<char v>, int mx, int my, int Mx, int My):
      |   ^~~~
a.cc:10:3: note:   candidate expects 5 arguments, 6 provided
a.cc:7:8: note: candidate: 'node::node(const node&)'
    7 | struct node {
      |        ^~~~
a.cc:7:8: note:   candidate expects 1 argument, 6 provided
a.cc:7:8: note: candidate: 'node::node(node&&)'
a.cc:7:8: note:   candidate expects 1 argument, 6 provided
a.cc:38:10: error: 'map' was not declared in this scope
   38 |     for (map<char, node>::iterator it = G.begin();
      |          ^~~
a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    3 | #include <vector>
  +++ |+#include <map>
    4 | 
a.cc:38:14: error: expected primary-expression before 'char'
   38 |     for (map<char, node>::iterator it = G.begin();
      |              ^~~~
a.cc:39:10: error: 'it' was not declared in this scope; did you mean 'int'?
   39 |          it != G.end(); it++) {
      |          ^~
      |          int
a.cc:39:16: error: 'G' was not declared in this scope
   39 |          it != G.end(); it++) {
      |                ^
a.cc:52:51: error: no matching function for call to 'node::node(std::vector<int>, int&, int&, int&, int&, char&)'
   52 |       G[c] = node(vector<int>(), mx, my, Mx, My, c);
      |                                                   ^
a.cc:10:3: note: candidate: 'node::node(int, int, int, int, int)'
   10 |   node(vector<char v>, int mx, int my, int Mx, int My):
      |   ^~~~
a.cc:10:3: note:   candidate expects 5 arguments, 6 provided
a.cc:7:8: note: candidate: 'node::node(const node&)'
    7 | struct node {
      |        ^~~~
a.cc:7:8: note:   candidate expects 1 argument, 6 provided
a.cc:7:8: note: candidate: 'node::node(node&&)'
a.cc:7:8: note:   candidate expects 1 argument, 6 provided