Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#define MAX_V 102
#define INF (int)1e9

using namespace std;


struct edge{int to,cap,rev;};
vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from,int to,int cap){
	G[from].push_back((edge){to,cap,(int)G[to].size()});
	G[to].push_back((edge){from,0,(int)G[from].size()-1});
}

int dfs(int v, int t,int f){
	if(v == t) return f;
	used[v] = true;
	for (int i = 0; i < G[v].size(); ++i)
	{
		edge &e = G[v][i];
		if(!used[e.to] && e.cap > 0){
			int d = dfs(e.to,t,min(f,e.cap));
			if(d > 0){
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}
int max_flow(int s, int t){
	int flow = 0;
	for(;;){
		memset(used,0,sizeof(used));
		int f = dfs(s,t,INF);
		if(f == 0) return flow;
		flow += f;
	}
}
int main(){
	int V,E,c[3][E];
	cin >> V >> E;
	for (int i = 0; i < E; ++i)
	{
		int from,to,cap;
		cin >> from >> to >> cap;
		add_edge(from,to,cap);
	}
	int ans = max_flow(0,V-1);
	cout << ans << endl;
	return 0;
samemset c++ includeinclude #include <iostream>
#include <vector>
#define MAX_V 102
#define INF (int)1e9

using namespace std;


struct edge{int to,cap,rev;};
vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from,int to,int cap){
	G[from].push_back((edge){to,cap,(int)G[to].size()});
	G[to].push_back((edge){from,0,(int)G[from].size()-1});
}

int dfs(int v, int t,int f){
	if(v == t) return f;
	used[v] = true;
	for (int i = 0; i < G[v].size(); ++i)
	{
		edge &e = G[v][i];
		if(!used[e.to] && e.cap > 0){
			int d = dfs(e.to,t,min(f,e.cap));
			if(d > 0){
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}
int max_flow(int s, int t){
	int flow = 0;
	for(;;){
		memset(used,0,sizeof(used));
		int f = dfs(s,t,INF);
		if(f == 0) return flow;
		flow += f;
	}
}
int main(){
	int V,E,c[3][E];
	cin >> V >> E;
	for (int i = 0; i < E; ++i)
	{
		int from,to,cap;
		cin >> from >> to >> cap;
		add_edge(from,to,cap);
	}
	int ans = max_flow(0,V-1);
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:57:29: error: stray '#' in program
   57 | samemset c++ includeinclude #include <iostream>
      |                             ^
a.cc: In function 'int main()':
a.cc:57:1: error: 'samemset' was not declared in this scope; did you mean 'wmemset'?
   57 | samemset c++ includeinclude #include <iostream>
      | ^~~~~~~~
      | wmemset
a.cc:69:39: error: a function-definition is not allowed here before '{' token
   69 | void add_edge(int from,int to,int cap){
      |                                       ^
a.cc:74:28: error: a function-definition is not allowed here before '{' token
   74 | int dfs(int v, int t,int f){
      |                            ^
a.cc:91:27: error: a function-definition is not allowed here before '{' token
   91 | int max_flow(int s, int t){
      |                           ^
a.cc:100:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  100 | int main(){
      |         ^~
a.cc:100:9: note: remove parentheses to default-initialize a variable
  100 | int main(){
      |         ^~
      |         --
a.cc:100:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:100:11: error: a function-definition is not allowed here before '{' token
  100 | int main(){
      |           ^
a.cc:112:2: error: expected '}' at end of input
  112 | }
      |  ^
a.cc:45:11: note: to match this '{'
   45 | int main(){
      |           ^