Language: C++

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<math.h>
#include<queue>
#include<functional>
#include<limits.h>
#include<string.h>
#include<set>
using namespace std;
#define P pair<int,int>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
 
const LL MAX_V = 20000;
class Dinic
{
	// 辺を表す構造体（行先、容量、逆辺）
	struct edge { LL to, cap, rev; };
 
	std::vector<edge>G[MAX_V];	// グラフの隣接リスト表現
	LL level[MAX_V];			// sからの距離
	LL iter[MAX_V];				// どこまで調べ終わったか
 
public:
	// fromからtoへ向かう容量capの辺をグラフに追加する
	void add_edge(LL from, LL to, LL cap)
	{
		G[from].push_back({ to, cap, G[to].size() });
		G[to].push_back({ from,0,G[from].size() - 1 });
	}
 
	// sからの最短距離をBFSで計算する
	void bfs(LL s)
	{
		memset(level, -1, sizeof(level));
		std::queue<LL>que;
		level[s] = 0;
		que.push(s);
		while (!que.empty())
		{
			LL v = que.front(); que.pop();
			for (auto i : G[v])
			{
				edge &e = i;
				if (e.cap > 0 && level[e.to] < 0)
				{
					level[e.to] = level[v] + 1;
					que.push(e.to);
				}
			}
		}
	}
 
	// 増加パスをDFSで探す
	LL dfs(LL v, LL t, LL f)
	{
		if (v == t) { return f; }
		for (LL &i = iter[v]; i < G[v].size(); ++i)
		{
			edge &e = G[v][i];
			if (e.cap > 0 && level[v] < level[e.to])
			{
				LL d = dfs(e.to, t, std::min(f, e.cap));
				if (d > 0)
				{
					e.cap -= d;
					G[e.to][e.rev].cap += d;
					return d;
				}
			}
		}
		return 0;
	}
 
	// sからtへの最大流を求める
	LL max_flow(LL s, LL t)
	{
		LL flow = 0;
		while (true)
		{
			bfs(s);
			if (level[t] < 0) { return flow; }
			memset(iter, 0, sizeof(iter));
			LL f;
			while ((f = dfs(s, t, INF)) > 0) { flow += f; }
		}
	}
};
 
int N, G, E, p[20000], a[112345], b[112345];
Dinic tree;
 
signed main() {
	int S[100][100];//番号
	int a, b; cin >> a >> b;
	memset(S, -1, sizeof(S));
	string c[100];
	P s, g;
	int sum = 2;
	for (int i = 0; i < a; i++) {
		cin >> c[i];
		for (int j = 0; j < b; j++) {
			if (c[i][j] == 'S') {
				s = { i,j };
				S[i][j] = 0;
				tree.add_edge(0, 1, 1);
			}
			else if (c[i][j] == 'T') {
				g = { i,j };
				S[i][j] = 1;
				tree.add_edge(2, 3, 1);
			}
			else if (c[i][j] == 'o') {
				S[i][j] = sum++;
				tree.add_edge(S[i][j] * 2+1, S[i][j] * 2,1);
			}
		}
	}
	if (s.first == g.first || s.second == g.second) {
		puts("-1");
		return 0;
	}
	for (int i = 0; i < a; i++) {
		for (int j = 0; j < b; j++) {
			if (S[i][j] != -1) {
				for (int k = i + 1; k < a; k++) {
					if (S[k][j] != -1) {
						tree.add_edge(S[i][j]*2, S[k][j]*2+1, 1);
						tree.add_edge(S[k][j]*2, S[i][j]*2+1, 1);
					}
				}
				for (int k = j + 1; k < b; k++) {
					if (S[i][k] != -1) {
						tree.add_edge(S[i][j]*2, S[i][k]*2+1, 1);
						tree.add_edge(S[i][k]*2, S[i][j]*2+1, 1);
					}
				}
			}
		}
	}
	cout << tree.max_flow(0, 3) << endl;
}

Compiler output:
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |  
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
   30 |  
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |  
      | ^
a.cc:42:1: error: extended character   is not valid in an identifier
   42 |  
      | ^
a.cc:64:1: error: extended character   is not valid in an identifier
   64 |  
      | ^
a.cc:85:1: error: extended character   is not valid in an identifier
   85 |  
      | ^
a.cc:100:1: error: extended character   is not valid in an identifier
  100 |  
      | ^
a.cc:103:1: error: extended character   is not valid in an identifier
  103 |  
      | ^
a.cc:24:1: error: '\U000000a0' does not name a type
   24 |  
      | ^
a.cc:30:1: error: '\U000000a0' does not name a type
   30 |  
      | ^
a.cc:32:18: error: 'MAX_V' was not declared in this scope
   32 |         LL level[MAX_V];                        // sからの距離
      |                  ^~~~~
a.cc:33:17: error: 'MAX_V' was not declared in this scope
   33 |         LL iter[MAX_V];                         // どこまで調べ終わったか
      |                 ^~~~~
a.cc:34:1: error: '\U000000a0' does not name a type
   34 |  
      | ^
a.cc:42:1: error: '\U000000a0' does not name a type
   42 |  
      | ^
a.cc:64:1: error: '\U000000a0' does not name a type
   64 |  
      | ^
a.cc:85:1: error: '\U000000a0' does not name a type
   85 |  
      | ^
a.cc:100:1: error: '\U000000a0' does not name a type
  100 |  
      | ^
a.cc:103:1: error: '\U000000a0' does not name a type
  103 |  
      | ^