Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <map>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <ctime>
#include <queue>
#include <set>
#include <string>

using namespace std;

const int MM = 900010;
const int NN = 3010;
const int INF = 0x7fffffff;

struct data
{
	int u, v;
}mat[MM];

typedef struct node{
    int v, w;
    struct node *nxt, *op;
	int ju;
}NODE;

NODE edg[MM]; // 菫晏ュ俶園譛臥噪霎ケ
NODE *Tlink[NN]; // 隶ー蠖戊鰍轤ケ謇?惠體セ陦ィ逧?ヲ冶鰍轤ケ
int h[NN];    // 霍晉ヲサ譬?捷?瑚ョー蠖墓ッ丈クェ轤ケ蛻ー豎?せ逧?キ晉ヲサ?瑚ソ咎?逧?キ晉ヲサ謖?噪譏ッ螻よ焚
int num[NN];  // gap莨伜喧?梧?蜿キ荳コi逧?。カ轤ケ荳ェ謨ー

int M, N, idx, S, T, n; // S 陦ィ遉コ貅千せ?卦陦ィ遉コ豎?せ?系陦ィ遉コ闃らせ荳ェ謨ー, idx鄂ョ0
void add(int u, int v, int c, int fl){
    idx++;
    edg[idx].v = v;
    edg[idx].w = c;
    edg[idx].nxt = Tlink[u];
    edg[idx].op = edg + idx + 1;
	edg[idx].ju = -1;
    Tlink[u] = edg + idx;    
    idx++;
    edg[idx].v = u;
    edg[idx].w = 0;
    edg[idx].nxt = Tlink[v];
    edg[idx].op = edg + idx - 1;
	edg[idx].ju = fl;
    Tlink[v] = edg + idx;
}

int Min(int a, int b){
    return a < b ? a : b;
}

int aug(int u, int flow){
    if (u == T) return flow;
    int l = flow;  // l陦ィ遉コ蜑ゥ菴吝ョケ驥?    int mytmp = n - 1;
    for (NODE *p = Tlink[u]; p; p = p->nxt){
        if (h[u] == h[p->v] + 1 && p->w){
            int f = aug(p->v, Min(l, p->w));
            l -= f;
            p->w -= f;
            p->op->w += f;
            if (l == 0 || h[S] == n) return flow - l; // gap
        }
        // 霑咎?譏ッ譛牙黄菴吝ョケ驥冗噪蜿ッ陦瑚セケ
        if (p->w > 0 && h[p->v] < mytmp){
            mytmp = h[p->v]; 
        }
    }
    if(l == flow){//  螯よ棡豐。譛画伽蛻ー蠅樊オ?シ梧燕菫ョ謾ケ譬?捷?悟?蠑?ァ句?髞吩コ?シ御ケ滓擶蜈キ逧?ソ?コ?・ス螟夐「?        num[h[u]]--;   // gap
        if (num[h[u]] == 0) h[S] = n; // gap?梧ッ丈クェ轤ケ逧?キ晉ヲサ蛟シ譛?、壻クコn - 1?瑚ソ咎?隶セ荳コn 陦ィ遉コ譁ュ螻ゆコ?        else{
            h[u] = mytmp + 1;
            num[h[u]]++;   // gap
        }
    }
    return flow - l;
}
/*n陦ィ遉コ諤サ轤ケ逧?クェ謨ー?悟桁諡ャ貅千せ蜥梧ア?せ*/
int sap(){
    int ans = 0;
    memset(h, 0, sizeof(h)); // h 菫晏ュ倡噪譏ッ霍晉ヲサ譬?捷(蛻ー豎?せ逧?
    memset(num, 0, sizeof(num));
    num[0] = n;
    while(h[S] < n){
        ans += aug(S, INF);
    }
    return ans;
}

int res[1010];
vector<int> ve;

int main(void)
{
	while(scanf("%d %d", &N, &M) != EOF)
	{
		memset(Tlink, 0, sizeof(Tlink));
		idx = 0;
		for(int i = 1; i <= M; ++i)
		{
			int a, b;
			scanf("%d %d", &a, &b);
			add(i + N, i + N + M, 1, 0);
			add(a, i + N, 1, 0);
			add(i + N + M, b, 1, 0);
			add(b, i + N, 1, 0);
			add(i + N + M, a, 1, 0);
			res[i] = idx;
		}
		scanf("%d %d", &S, &T);
		n = N + M + M + 1;
		int ans = sap();
		printf("%d\n", ans);
		ve.clear();
		for(int i = 1; i <= M; ++i)
		{
			if(edg[res[i]].w)
				ve.push_back(i);
		}
		printf("%d\n", ve.size());
		if(ve.size() > 0)
			for(int i = 0; i < ve.size(); ++i)
				printf("%d\n", ve[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int aug(int, int)':
a.cc:71:35: error: 'mytmp' was not declared in this scope; did you mean 'mktemp'?
   71 |         if (p->w > 0 && h[p->v] < mytmp){
      |                                   ^~~~~
      |                                   mktemp
a.cc:77:20: error: 'mytmp' was not declared in this scope; did you mean 'mktemp'?
   77 |             h[u] = mytmp + 1;
      |                    ^~~~~
      |                    mktemp
a.cc: At global scope:
a.cc:81:5: error: expected unqualified-id before 'return'
   81 |     return flow - l;
      |     ^~~~~~
a.cc:82:1: error: expected declaration before '}' token
   82 | }
      | ^
a.cc: In function 'int aug(int, int)':
a.cc:80:5: warning: control reaches end of non-void function [-Wreturn-type]
   80 |     }
      |     ^