prog.cpp:1:18: error: expected primary-expression before ‘...’ token
const int MAXN = ...; // число вершин
^~~
prog.cpp:8:20: error: size of array ‘d’ is not an integral constant-expression
int n, s, t, d[MAXN], ptr[MAXN], q[MAXN];
^
prog.cpp:8:31: error: size of array ‘ptr’ is not an integral constant-expression
int n, s, t, d[MAXN], ptr[MAXN], q[MAXN];
^
prog.cpp:8:40: error: size of array ‘q’ is not an integral constant-expression
int n, s, t, d[MAXN], ptr[MAXN], q[MAXN];
^
prog.cpp:9:1: error: ‘vector’ does not name a type
vector<edge> e;
^~~~~~
prog.cpp:10:1: error: ‘vector’ does not name a type
vector<int> g[MAXN];
^~~~~~
prog.cpp: In function ‘void add_edge(int, int, int)’:
prog.cpp:15:2: error: ‘g’ was not declared in this scope
g[a].push_back ((int) e.size());
^
prog.cpp:15:24: error: ‘e’ was not declared in this scope
g[a].push_back ((int) e.size());
^
prog.cpp: In function ‘bool bfs()’:
prog.cpp:24:32: error: ‘memset’ was not declared in this scope
memset (d, -1, n * sizeof d[0]);
^
prog.cpp:28:8: error: ‘size_t’ was not declared in this scope
for (size_t i=0; i<g[v].size(); ++i) {
^~~~~~
prog.cpp:28:20: error: ‘i’ was not declared in this scope
for (size_t i=0; i<g[v].size(); ++i) {
^
prog.cpp:28:22: error: ‘g’ was not declared in this scope
for (size_t i=0; i<g[v].size(); ++i) {
^
prog.cpp:31:10: error: ‘to’ was not declared in this scope
if (d[to] == -1 && e[id].flow < e[id].cap) {
^~
prog.cpp:31:23: error: ‘e’ was not declared in this scope
if (d[to] == -1 && e[id].flow < e[id].cap) {
^
prog.cpp: In function ‘int dfs(int, int)’:
prog.cpp:43:21: error: ‘g’ was not declared in this scope
for (; ptr[v]<(int)g[v].size(); ++ptr[v]) {
^
prog.cpp:46:9: error: ‘to’ was not declared in this scope
if (d[to] != d[v] + 1) continue;
^~
prog.cpp:47:21: error: ‘to’ was not declared in this scope
int pushed = dfs (to, min (flow, e[id].cap - e[id].flow));
^~
prog.cpp:47:36: error: ‘e’ was not declared in this scope
int pushed = dfs (to, min (flow, e[id].cap - e[id].flow));
^
prog.cpp:47:58: error: ‘min’ was not declared in this scope
int pushed = dfs (to, min (flow, e[id].cap - e[id].flow));
^
prog.cpp: In function ‘int dinic()’:
prog.cpp:61:36: error: ‘memset’ was not declared in this scope
memset (ptr, 0, n * sizeof ptr[0]);
^