Submission #862154

# Submission time Handle Problem Language Result Execution time Memory
862154 2023-10-17T14:51:07 Z Mizo_Compiler Logičari (COCI21_logicari) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
#define pb push_back
#define sz(x) int32_t(x.size())
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define int long long
const int N = 1e5+5;
int n, dp[N][2][2], dp2[N][2][2][2][2], tr[N], dp3[N][2][2];
vector<int> adj[N], cyc;
bool inc[N], ins[N], vis[N];

void get_cyc(int u, int p) {
	if (!cyc.empty())return;
	if (ins[u]) {
		cyc.pb(u);
		int cur = tr[u];
		inc[u] = true;
		while (cur != u) {
			cyc.pb(cur);
			inc[cur] = true;
			cur = tr[cur];
		}
		return;
	}
	if (vis[u])return;
	vis[u] = ins[u] = true;
	for (auto &v : adj[u]) {
		if (v == p)continue;
		tr[u] = v;
		get_cyc(v, u);
	}
	ins[u] = false;
}

int sol2(int u, int p, int val, int pv) {
	int &ret = dp[u][val][pv];
	if (~ret)return ret;
	ret = val;
	if (!pv) {
		int mn = -1e9;
		int f, s;
		bool fl = false, f2 = false, fx = false;
		for (auto &v : adj[u]) {
			if (v == p || inc[v])continue;
			fx = true;
			f = sol2(v, u, 0, val), s = sol2(v, u, 1, val);
			if (f == s && f == int32_t(1e9))return ret = int32_t(1e9);
			if (f == int32_t(1e9)) {
				if (fl)return ret = int32_t(1e9);
				ret += (mn == -1e9 ? 0 : mn);
				mn = -1e9;
				fl = true;
				ret += s;
				continue;
			}
			if (s == int32_t(1e9)) {
				ret += f;
				continue;
			}
			if (f-s > mn) {
				ret += (mn == -1e9 ? 0 : mn);
				mn = f-s;
				ret += s;
				f2 = true;
			} else {
				ret += f;
			}
		}
		if (!fx || (!fl && !f2))return ret = int32_t(1e9);
	} else {
		for (auto &v : adj[u]) {
			if (v == p || inc[v])continue;
			ret += sol2(v, u, 0, val);
			if (ret > int32_t(1e9))return ret = int32_t(1e9);
		}
	}
	return ret;
}

int get(int u, int x, int val) {
	int &ret = dp3[u][x][val];
	if (~ret)return ret;
	ret = 0;
	bool fx = false;
	if (!x) {
		int mn = -1e9;
		bool fl = false, f2 = false;
		for (auto &v : adj[u]) {
			if (inc[v])continue;
			fx = true;
			int f = sol2(v, u, 0, val), s = sol2(v, u, 1, val);
			if (f == s && f == int32_t(1e9))return ret = int32_t(1e9);
			if (f == int32_t(1e9)) {
				if (fl)return ret = int32_t(1e9);
				ret += (mn == -1e9 ? 0 : mn);
				mn = -1e9;
				fl = true;
				ret += s;
				continue;
			}
			if (s == int32_t(1e9)) {
				ret += f;
				continue;
			}
			if (f-s > mn) {
				ret += (mn == -1e9 ? 0 : mn);
				mn = f-s;
				ret += s;
				f2 = true;
			} else {
				ret += f;
			}
		}
		if (!fx)return ret = int32_t(1e9);
		if (!fl && !f2)return ret = int32_t(1e9);
	} else {
		for (auto &v : adj[u]) {
			if (inc[v])continue;
			ret += sol2(v, u, 0, val);
			if (ret > int32_t(1e9))return ret = int32_t(1e9);
		}
	}
	return ret;
}

int sol(int i, int ls, int nls, int f, int nf) {
	int &ret = dp2[i][ls][nls][f][nf];
	if (~ret)return ret;
	if (!i) {
		int c1 = get(cyc[i], 0, 0) + sol(i+1, 0, 1, 0, 1);
		c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
		c1 = int32_t(1e9);
		int c2 = get(cyc[i], 0, 1) + 1 + sol(i+1, 1, 1, 1, 1);
		c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
		return ret = min({int32_t(1e9), c1, c2});
	} else if (i == sz(cyc) - 1) {
		if (f && ls)return ret = int32_t(1e9);
		if (nf+nls == 1)return ret = int32_t(1e9);
		if (nf + nls == 0) {
			if (f + ls == 0) {
				return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
			} else {
				return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
			}
		}
		if (f + ls == 0)return ret = get(cyc[i], 0, 0);
		return ret = get(cyc[i], 1, 0);
	} else if (i == 1) {
		if (ls) {
			if (nf)return ret = min(int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 1, f, nf));
			int c1 = get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 1, f, 1);
			int c2 = get(cyc[i], 1, 0) + sol(i+1, 0, 1, f, 0);
			return ret = min({int32_t(1e9), c1, c2});
		}
		if (nf)return ret = min(int32_t(1e9), get(cyc[i], 0, 0) + sol(i+1, 0, 1, f, nf));
		int c1 = get(cyc[i], 0, 1) + 1 + sol(i+1, 1, 1, f, 1);
		c1 = min(c1, get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, f, 1));
		int c2 = get(cyc[i], 0, 0) + sol(i+1, 0, 1, f, 0);
		c2 = min(c2, get(cyc[i], 1, 0) + sol(i+1, 0, 0, f, 0));
		return ret = min({int32_t(1e9), c1, c2});
	} else {
		if (!nls) {
			int c1 = get(cyc[i], ls, 1)+1+sol(i+1, 1, 1, f, nf);
			c1 = min(c1, get(cyc[i], 1, 1)+1+sol(i+1, 1, ls, f, nf));
			return ret = min(int32_t(1e9), c1);
		}
		int c1 = get(cyc[i], ls, 0)+sol(i+1, 0, 1, f, nf);
		c1 = min(c1, get(cyc[i], 1, 0)+sol(i+1, 0, ls, f, nf));
		return ret = min(int32_t(1e9), c1);
	}
	return ret;
}

signed main () {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> n;
	for (int i = 0; i < n; i++) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		adj[u].pb(v);
		adj[v].pb(u);
		for (int j = 0; j < 2; j++) {
			for (int k = 0; k < 2; k++) {
				dp[i][j][k] = dp3[i][j][k] = -1;
				for (int l = 0; l < 2; l++) {
					for (int m = 0; m < 2; m++) {
						dp2[i][j][k][l][m] = -1;
					}
				}
			}
		}
	}
	get_cyc(0, 0);
	int x = sol(0, 0, 0, 0, 0);
	cout << (x > n ? -1 : x) << "\n";
}

Compilation message

Main.cpp: In function 'long long int sol(long long int, long long int, long long int, long long int, long long int)':
Main.cpp:135:72: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
  135 |   c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
      |                                                                        ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:135:72: note:   candidate expects 2 arguments, 1 provided
  135 |   c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
      |                                                                        ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:135:72: note:   candidate expects 3 arguments, 1 provided
  135 |   c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
      |                                                                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
Main.cpp:135:72: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
  135 |   c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
      |                                                                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
Main.cpp:135:72: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
  135 |   c1 = min({c1, int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 0, 0, 0)});
      |                                                                        ^
Main.cpp:138:76: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
  138 |   c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
      |                                                                            ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:138:76: note:   candidate expects 2 arguments, 1 provided
  138 |   c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
      |                                                                            ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:138:76: note:   candidate expects 3 arguments, 1 provided
  138 |   c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
      |                                                                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
Main.cpp:138:76: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
  138 |   c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
      |                                                                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
Main.cpp:138:76: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
  138 |   c2 = min({c2, int32_t(1e9), get(cyc[i], 1, 1) + 1 + sol(i+1, 1, 0, 1, 0)});
      |                                                                            ^
Main.cpp:139:42: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
  139 |   return ret = min({int32_t(1e9), c1, c2});
      |                                          ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:139:42: note:   candidate expects 2 arguments, 1 provided
  139 |   return ret = min({int32_t(1e9), c1, c2});
      |                                          ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:139:42: note:   candidate expects 3 arguments, 1 provided
  139 |   return ret = min({int32_t(1e9), c1, c2});
      |                                          ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
Main.cpp:139:42: note:   deduced conflicting types for parameter '_Tp' ('int' and 'long long int')
  139 |   return ret = min({int32_t(1e9), c1, c2});
      |                                          ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
Main.cpp:139:42: note:   deduced conflicting types for parameter '_Tp' ('int' and 'long long int')
  139 |   return ret = min({int32_t(1e9), c1, c2});
      |                                          ^
Main.cpp:145:57: error: no matching function for call to 'min(int32_t, long long int)'
  145 |     return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
      |                                                         ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:145:57: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  145 |     return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
      |                                                         ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:145:57: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  145 |     return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
      |                                                         ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
Main.cpp:145:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  145 |     return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
      |                                                         ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
Main.cpp:145:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  145 |     return ret = min(int32_t(1e9), get(cyc[i], 0, 1) + 1);
      |                                                         ^
Main.cpp:147:57: error: no matching function for call to 'min(int32_t, long long int)'
  147 |     return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
      |                                                         ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:147:57: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  147 |     return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
      |                                                         ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:147:57: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  147 |     return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
      |                                                         ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
Main.cpp:147:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  147 |     return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
      |                                                         ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
Main.cpp:147:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  147 |     return ret = min(int32_t(1e9), 1 + get(cyc[i], 1, 1));
      |                                                         ^
Main.cpp:154:83: error: no matching function for call to 'min(int32_t, long long int)'
  154 |    if (nf)return ret = min(int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 1, f, nf));
      |                                                                                   ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
Main.cpp:154:83: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  154 |    if (nf)return ret = min(int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 1, f, nf));
      |                                                                                   ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
Main.cpp:154:83: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
  154 |    if (nf)return ret = min(int32_t(1e9), get(cyc[i], 1, 0) + sol(i+1, 0, 1, f, nf));
      |                                                                                   ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from /var/local/lib/isolate/692/bo