Language: C++

#include<iostream>
#include<cmath>
using namespace std;
long long a[200000];
long long min[200000];
int main()
{
	int num, counts;
	while (cin >> num)
	{
		
		for (int i = 0; i < num; i++)
			cin >> a[i];//input comlete
		int sum, latersum, frontsum, Min;
		counts = sum = latersum = frontsum = Min = 0;

		for (int i = 0; i < num; i++)
			sum += a[i];
		for (int j = 0; j < num-1; j++)
		{
			for (int k = num - counts - 2; k >= 0; k--)//k>0？
			{
				
				frontsum += a[k];//少了一个
				counts++;
			}
			latersum = sum - frontsum;
			min[j] = abs(latersum - frontsum);
			frontsum = 0;
			counts = j + 1;

		}
		
		
		Min = min[0];
		for (int n = 1; n < num-1; n++)
			if (min[n] < Min)
				Min = min[n];
		cout << Min;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: reference to 'min' is ambiguous
   28 |                         min[j] = abs(latersum - frontsum);
      |                         ^~~
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:1:
/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:5:11: note:                 'long long int min [200000]'
    5 | long long min[200000];
      |           ^~~
a.cc:35:23: error: reference to 'min' is ambiguous
   35 |                 Min = min[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:5:11: note:                 'long long int min [200000]'
    5 | long long min[200000];
      |           ^~~
a.cc:37:29: error: reference to 'min' is ambiguous
   37 |                         if (min[n] < 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:5:11: note:                 'long long int min [200000]'
    5 | long long min[200000];
      |           ^~~
a.cc:38:39: error: reference to 'min' is ambiguous
   38 |                                 Min = min[n];
      |                                       ^~~
/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:5:11: note:                 'long long int min [200000]'
    5 | long long min[200000];
      |           ^~~