Language: C++

#define scanf_s scanf
#include <stdio.h>
#include<iostream>
#include <list>
#include <vector>
#include <iostream>
using namespace std;
#define MAX 101
struct node
{
	list<int> li;
	list<int> cost;
};
int  sum = 0, n, m, s, g, ans, min = -1;
node x[MAX];
void sai(int N, int a,int f) {
	if (N < m) {
		if (f == a) {
			if (min == -1 || min > sum) min = sum;
			return;
		}
		else {
			for (auto i = x[a].li.begin(), j = x[a].cost.begin(); i != x[a].li.end(); ++i, ++j) {
				if (min == -1 || min > sum) {
					sum += *j;
					sai(N + 1, *i, f);
					sum -= *j;
				}
			}
		}
	}
}
int main()
{
	int a, b, c, d, V, P;
	scanf_s("%d", &n);
	scanf_s("%d", &m);
	for (int i = 0; i < m; ++i) {
		scanf_s("%d,%d,%d,%d", &a, &b, &c, &d);
		x[a].li.push_back(b); x[a].cost.push_back(c);
		x[b].li.push_back(a); x[b].cost.push_back(d);
	}
	for (int k = 1; k <= n; ++k) {
		for (auto i = x[k].li.begin(), j = x[k].cost.begin(); i != x[k].li.end(); ++i, ++j) {
		}
	}
	scanf_s("%d,%d,%d,%d", &s, &g, &V, &P);
	sai(0, s, g);
	ans += min; min = -1; sum = 0;
	sai(0, g, s);
	ans += min;
	ans = V - (ans + P);
	printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'void sai(int, int, int)':
a.cc:19:29: error: reference to 'min' is ambiguous
   19 |                         if (min == -1 || min > sum) min = sum;
      |                             ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:19:42: error: reference to 'min' is ambiguous
   19 |                         if (min == -1 || min > sum) min = sum;
      |                                          ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:19:53: error: reference to 'min' is ambiguous
   19 |                         if (min == -1 || min > sum) min = sum;
      |                                                     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:24:37: error: reference to 'min' is ambiguous
   24 |                                 if (min == -1 || min > sum) {
      |                                     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:24:50: error: reference to 'min' is ambiguous
   24 |                                 if (min == -1 || min > sum) {
      |                                                  ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc: In function 'int main()':
a.cc:49:16: error: reference to 'min' is ambiguous
   49 |         ans += min; min = -1; sum = 0;
      |                ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:49:21: error: reference to 'min' is ambiguous
   49 |         ans += min; min = -1; sum = 0;
      |                     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~
a.cc:51:16: error: reference to 'min' is ambiguous
   51 |         ans += min;
      |                ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:14:32: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans, min = -1;
      |                                ^~~