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,flag = 0,min = -1;
void sai(int N, int a,int f) {
	if (N < m) {
		if (f == a) { //&& flag == 0) {
			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:18:29: error: reference to 'min' is ambiguous
   18 |                         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:18:42: error: reference to 'min' is ambiguous
   18 |                         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:18:53: error: reference to 'min' is ambiguous
   18 |                         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:22:39: error: 'x' was not declared in this scope
   22 |                         for (auto i = x[a].li.begin(), j = x[a].cost.begin(); i != x[a].li.end(); ++i, ++j) {
      |                                       ^
a.cc:22:106: error: 'j' was not declared in this scope
   22 |                         for (auto i = x[a].li.begin(), j = x[a].cost.begin(); i != x[a].li.end(); ++i, ++j) {
      |                                                                                                          ^
a.cc:23:37: error: reference to 'min' is ambiguous
   23 |                                 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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:23:50: error: reference to 'min' is ambiguous
   23 |                                 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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc: In function 'int main()':
a.cc:39:17: error: 'x' was not declared in this scope
   39 |                 x[a].li.push_back(b); x[a].cost.push_back(c);
      |                 ^
a.cc:43:31: error: 'x' was not declared in this scope
   43 |                 for (auto i = x[k].li.begin(), j = x[k].cost.begin(); i != x[k].li.end(); ++i, ++j) {
      |                               ^
a.cc:43:98: error: 'j' was not declared in this scope
   43 |                 for (auto i = x[k].li.begin(), j = x[k].cost.begin(); i != x[k].li.end(); ++i, ++j) {
      |                                                                                                  ^
a.cc:48:16: error: reference to 'min' is ambiguous
   48 |         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:48:21: error: reference to 'min' is ambiguous
   48 |         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~
a.cc:50:16: error: reference to 'min' is ambiguous
   50 |         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:40: note:                 'int min'
   14 | int  sum = 0, n, m, s, g, ans,flag = 0,min = -1;
      |                                        ^~~