Language: C++

class Networkflow {
private:
	struct edgedata {
		int to, weight, capacity;
		edgedata* dual_p;
	};
	struct node {
		int id;
		bool done;
		vector<edgedata> edge;
	};
	vector<node> nodes;
	int n;
	int source, sink;
public:
	int result;
	Networkflow(vector<vector<pair<int, P>>> data, int s, int t) {
		n = data.size();
		source = s;
		sink = t;
		nodes.resize(n);
		Loop(i, n) {
			nodes[i] = { i, false, {} };
		}
		edgedata* dummy = new edgedata;
		Loop(i, n) {
			Loop(j, data[i].size()) {
				nodes[i].edge.push_back({
					data[i][j].first,
					data[i][j].second.first,
					data[i][j].second.second,
					dummy
				});
				nodes[data[i][j].first].edge.push_back({
					i,
					data[i][j].second.first,
					0,
					&(nodes[i].edge.back())
				});
				nodes[i].edge.back().dual_p = &(nodes[data[i][j].first].edge.back());
			}
		}
		delete dummy;
	}
	void maxflow() {
		result = 0;
		stack<pair<int, edgedata*>> stk;
		int a; // the node which is focused on
		while (1) {
			a = source;
			Loop(i, n) nodes[i].done = false;
			nodes[source].done = true;
			while (a != sink) {
				int b = -1;
				edgedata* p;
				Loop(i, nodes[a].edge.size()) {
					if (nodes[a].edge[i].capacity > 0) {
						b = nodes[a].edge[i].to;
						if (nodes[b].done) b = -1;
						else {
							p = &(nodes[a].edge[i]);
							stk.push(make_pair(a, p));
							nodes[b].done = true;
							a = b;
							break;
						}
					}
				}
				if (b == -1) {
					if (stk.empty()) break;
					a = stk.top().first;
					stk.pop();
				}
			}
			if (stk.empty()) break;
			while (stk.size()) {
				(*(stk.top().second)).capacity--;
				(*((*(stk.top().second)).dual_p)).capacity++;
				stk.pop();
			}
			result++;
		}
		return;
	}
};


int main() {
	int v, e;
	cin >> v >> e;
	vector<vector<pair<int, P>>> data(v);
	Loop(i, e) {
		int u, v, c; cin >> u >> v >> c;
		data[u].push_back(make_pair(v, make_pair(1, c)));
	}
	Networkflow networkflow(data, 0, v - 1);
	networkflow.maxflow();
	cout << networkflow.result << endl;
	return 0;
}

Compiler output:
a.cc:10:17: error: 'vector' does not name a type
   10 |                 vector<edgedata> edge;
      |                 ^~~~~~
a.cc:12:9: error: 'vector' does not name a type
   12 |         vector<node> nodes;
      |         ^~~~~~
a.cc:17:27: error: expected ')' before '<' token
   17 |         Networkflow(vector<vector<pair<int, P>>> data, int s, int t) {
      |                    ~      ^
      |                           )
a.cc: In member function 'void Networkflow::maxflow()':
a.cc:47:17: error: 'stack' was not declared in this scope
   47 |                 stack<pair<int, edgedata*>> stk;
      |                 ^~~~~
a.cc:47:23: error: 'pair' was not declared in this scope
   47 |                 stack<pair<int, edgedata*>> stk;
      |                       ^~~~
a.cc:47:28: error: expected primary-expression before 'int'
   47 |                 stack<pair<int, edgedata*>> stk;
      |                            ^~~
a.cc:51:30: error: 'i' was not declared in this scope
   51 |                         Loop(i, n) nodes[i].done = false;
      |                              ^
a.cc:51:25: error: 'Loop' was not declared in this scope
   51 |                         Loop(i, n) nodes[i].done = false;
      |                         ^~~~
a.cc:52:25: error: 'nodes' was not declared in this scope; did you mean 'node'?
   52 |                         nodes[source].done = true;
      |                         ^~~~~
      |                         node
a.cc:70:45: error: 'stk' was not declared in this scope; did you mean 'std'?
   70 |                                         if (stk.empty()) break;
      |                                             ^~~
      |                                             std
a.cc:71:45: error: 'stk' was not declared in this scope; did you mean 'std'?
   71 |                                         a = stk.top().first;
      |                                             ^~~
      |                                             std
a.cc:75:29: error: 'stk' was not declared in this scope; did you mean 'std'?
   75 |                         if (stk.empty()) break;
      |                             ^~~
      |                             std
a.cc:76:32: error: 'stk' was not declared in this scope; did you mean 'std'?
   76 |                         while (stk.size()) {
      |                                ^~~
      |                                std
a.cc: In function 'int main()':
a.cc:90:9: error: 'cin' was not declared in this scope
   90 |         cin >> v >> e;
      |         ^~~
a.cc:91:9: error: 'vector' was not declared in this scope
   91 |         vector<vector<pair<int, P>>> data(v);
      |         ^~~~~~
a.cc:91:23: error: 'pair' was not declared in this scope
   91 |         vector<vector<pair<int, P>>> data(v);
      |                       ^~~~
a.cc:91:28: error: expected primary-expression before 'int'
   91 |         vector<vector<pair<int, P>>> data(v);
      |                            ^~~
a.cc:92:14: error: 'i' was not declared in this scope
   92 |         Loop(i, e) {
      |              ^
a.cc:92:9: error: 'Loop' was not declared in this scope
   92 |         Loop(i, e) {
      |         ^~~~
a.cc:96:33: error: 'data' was not declared in this scope
   96 |         Networkflow networkflow(data, 0, v - 1);
      |                                 ^~~~
a.cc:98:9: error: 'cout' was not declared in this scope
   98 |         cout << networkflow.result << endl;
      |         ^~~~
a.cc:98:39: error: 'endl' was not declared in this scope
   98 |         cout << networkflow.result << endl;
      |                                       ^~~~