Language: C

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <queue>
#include <ctime>
using namespace std;
template <class T> void checkmin(T &t,T x){if (x < t) t = x;}
template <class T> void checkmax(T &t,T x){if (x > t) t = x;}
template <class T> void _checkmin(T &t, T x){if (t == -1) t = x; if (x < t) t = x;}
template <class T> void _checkmax(T &t, T x){if (t == -1) t = x; if (x > t) t = x;}
typedef pair <int,int> PII;
typedef pair <double,double> PDD;
typedef long long lld;
#define foreach(it,v) for (__typeof((v).begin()) it = (v).begin();it != (v).end();it++)
#define DEBUG(a) cout << #a" = " << (a) << endl;
#define DEBUGARR(a, n) for (int i = 0; i < (n); i++) { cout << #a"[" << i << "] = " << (a)[i] << endl; }
const int full = 1 << 4;
char s[4100];
int len[4];
char st[4][70];
bool ok[4100][4];
int f[4100][70][1 << 4];

int main(){
#ifdef cwj
	freopen("in", "r", stdin);
#endif
	while (scanf("%s", s + 1) != EOF) {
		int m = 0;
		for (int i = 0; i < 4; i++) {
			scanf("%s", st[i]);
			len[i] = strlen(st[i]);
			checkmax(m, len[i]);
		}
		memset(ok, 0, sizeof(ok));
		int n = strlen(s + 1);
		for (int i = 1; i <= n; i++) {
			for (int j = 0; j < 4; j++) {
				bool o = 1;
				for (int k = 0; k < len[j]; k++) {
					if (st[j][k] != s[i + k]) {
						o = 0;
						break;
					}
				}
				ok[i][j] = o;
			}
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 1; j <= n; j++) {
				printf("%d", ok[j][i]);
			}
			puts("");
		}
		int ansmin = -1;
		int ansmax = -1;
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < full; k++) {
					f[i][j][k] = -1;
				}
			}
		}
		f[0][0][0] = 0;
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < full; k++) {
					if (f[i][j][k] != -1) {
						if (i == n) continue;
						for (int o = 0; o < 4; o++) {
							if (!(k & 1 << o) && ok[i + 1][o]) {
								_checkmax(f[i + 1][max(j - 1, len[o] - 1)][k | 1 << o]
									, f[i][j][k] + 1);
							}
							if (!(k & 1 << o) && ok[i][o]) {
								_checkmax(f[i][max(j, len[o] - 1)][k | 1 << o], f[i][j][k]);
							}
						}
						if (j) {
							_checkmax(f[i + 1][j - 1][k], f[i][j][k] + 1);
						} else {
							_checkmax(f[i + 1][0][k], f[i][j][k]);
						}
					}
				}
			}
		}
		for (int i = 0; i <= n; i++) {
			if (f[i][0][full - 1] != -1)
				_checkmax(ansmax, f[i][0][full - 1]);
		}

		for (int i = 0; i <= n; i++) {
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < full; k++) {
					f[i][j][k] = -1;
				}
			}
		}
		f[0][0][0] = 0;
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < full; k++) {
					if (f[i][j][k] != -1) {
						if (i == n) continue;
						for (int o = 0; o < 4; o++) {
							if (!(k & 1 << o) && ok[i + 1][o]) {
								_checkmin(f[i + 1][max(j - 1, len[o] - 1)][k | 1 << o]
									, f[i][j][k] + 1);
							}
							if (!(k & 1 << o) && ok[i][o]) {
								_checkmin(f[i][max(j, len[o] - 1)][k | 1 << o], f[i][j][k]);
							}
						}
						if (j) {
							_checkmin(f[i + 1][j - 1][k], f[i][j][k] + 1);
						} else {
							_checkmin(f[i + 1][0][k], f[i][j][k]);
						}
					}
				}
			}
		}
		for (int i = 0; i <= n; i++) {
			if (f[i][0][full - 1] != -1) {
				_checkmin(ansmin, f[i][0][full - 1]);
				cout << i << " " << 0 << " " << full - 1 << " " << f[i][0][full - 1] << endl;
			}
		}
		printf("%d %d\n", ansmin, ansmax);
	}
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.