Language: C++

/*
* E.cpp
*
*  Created on: Oct 9, 2012
*      Author: carber
*/

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

using namespace std;

const int NV = 305;
const int NE = 45000;

struct ISAP {
    int n, size;
    int head[NV];
    int dis[NV], gap[NV], pre[NV], cur[NV];
    int maxflow;

    struct Edge {
        int v, w, next;
        Edge () {}
        Edge (int V, int NEXT, int W = 0) : v(V), next(NEXT), w(W) { }
    }E[NE];

    void init(int x) {
        n = x, size = 0;
        for (int i = 0; i <= n; i++) {
            head[i] = -1;
        }
    }

    inline void insert(int u, int v, int w = 0) {
        E[size] = Edge(v, head[u], w);
        head[u] = size++;
        E[size] = Edge(u, head[v], w); //豬??蜿榊髄蟒コ霎ケ
        head[v] = size++;
    }

    int MaxFlow(int src, int des) {
        maxflow = 0;
        gap[0] = n;
        for (int i = 0; i <= n; i++) {
            dis[i] = gap[i] = 0;
        }
        for (int i = 0; i <= n; i++) {
            cur[i] = head[i];
        }
        int u = pre[src] = src;
        int aug = -1;
        while (dis[src] < n) {//扈捺據譚。莉カ1
loop:
            for (int &i = cur[u]; i != -1; i = E[i].next) {
                int v = E[i].v;
                if (E[i].w && dis[u] == dis[v] + 1) {
                    aug = min(aug, E[i].w);
                    pre[v] = u;
                    u = v;
                    if (v == des) {//謇セ蛻ー荳?擅蠅槫ケソ霍ッ?梧峩譁ー
                        maxflow += aug;
                        // //菫ョ謾ケ谿倶ス咏ス醍サ?                        for (u = pre[u]; v != src; v = u, u = pre[u]) {
                            E[cur[u]].w -= aug;//豁」蜷題セケ
                            E[cur[u]^1].w += aug;//蜿榊髄霎ケ
                        }
                        aug = INT_MAX;
                    }//if
                    goto loop;
                }//for
            }//for
            //蟇サ謇セ譛?ー冗噪霍晉ヲサ譬?捷?悟ケカ菫ョ謾ケ蠖灘燕轤ケ    荳コ譛?ー冗噪譬?捷+1
            int mdis = n;
            for (int i = head[u]; i != -1; i = E[i].next) {
                int v = E[i].v;
                if (E[i].w && mdis > dis[v]) {
                    cur[u] = i;
                    mdis = dis[v];
                }
            }//for

            //GAP 莨伜喧 譁ュ螻ょ?霍ウ蜃コ 扈捺據譚。莉カ2
            if ((--gap[dis[u]]) == 0) {
                break;
            }
            gap[dis[u] = mdis + 1]++;//蟆?凶譛芽ッ・譬?捷逧?焚驥丞刈1
            u = pre[u];//蠖灘燕闃らせ 霑∫ァサ荳?クェ
        }//while
        return maxflow;
    }//ISAP
}G;

#include <vector>
void solved(int nT) {
    int n, m, u, v;
    while (EOF != scanf("%d %d", &n, &m)) {
        G.init(n);
        for (int i = 0; i < m; ++i) {
            scanf("%d %d", &u, &v);
            --u, --v;
            if (u == v) while (true);
            G.insert(u, v, 1);
        }
        int s, t;
        scanf("%d %d", &s, &t);
        --s, --t;
        int result = G.MaxFlow(s, t);
        vector<int> ret;
        for (int se = 0; se < G.size; se += 2) {
            if (G.E[se].w == 2) ret.push_back(se >> 1);
        }
        printf("%d\n", result);
        printf("%d\n", (int)ret.size());
        for (int i = 0; i < (int)ret.size(); ++i) {
            printf("%d\n", ret[i] + 1);
        }
    }
}

int main() {
    int T = 1;
    for (int nT = 1; nT <= T; ++nT) {
        solved(nT);
    }
    return 0;
}

Compiler output:
a.cc:93:9: error: expected unqualified-id before 'return'
   93 |         return maxflow;
      |         ^~~~~~
a.cc:94:6: error: expected ';' after struct definition
   94 |     }//ISAP
      |      ^
      |      ;
a.cc: In member function 'int ISAP::MaxFlow(int, int)':
a.cc:71:31: error: 'INT_MAX' was not declared in this scope
   71 |                         aug = INT_MAX;
      |                               ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include <cmath>
  +++ |+#include <climits>
   14 | 
a.cc:88:17: error: break statement not within loop or switch
   88 |                 break;
      |                 ^~~~~
a.cc:92:9: warning: no return statement in function returning non-void [-Wreturn-type]
   92 |         }//while
      |         ^
a.cc: At global scope:
a.cc:95:1: error: expected declaration before '}' token
   95 | }G;
      | ^
a.cc:95:2: error: 'G' does not name a type
   95 | }G;
      |  ^
a.cc: In function 'void solved(int)':
a.cc:101:9: error: 'G' was not declared in this scope
  101 |         G.init(n);
      |         ^