Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"

long long int memo[2000];
long long int aws[10000];
int N, W;

int getans(const int l) {
	if (memo[l] ==-1) {
		int sum = 0;
		 int ans = 2e9 + 1;
		for (int r = l + 1; r <= N; ++r) {
			sum += aws[r - 1];
			if (r == N)ans = min(ans, max(0ll, sum - W));
			ans = min(ans, getans(r) + abs(sum - W));
		}
		memo[l] = ans;
	}
	return memo[l];
}
int main() {
	int num(0);
	while (1) {
		num++;
		cin >> N >> W;
		for (int i = 0; i < 2000; ++i) {
			memo[i] = -1;
		}
		if (!N)break;
		for (int i = 0; i < N; ++i) {
			cin >> aws[i];
		}
		long long int ans = getans(0);
		cout << "Case "<<num<<": "<<ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int getans(int)':
a.cc:21:54: error: no matching function for call to 'max(long long int, int)'
   21 |                         if (r == N)ans = min(ans, max(0ll, sum - W));
      |                                                   ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:21:54: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   21 |                         if (r == N)ans = min(ans, max(0ll, sum - W));
      |                                                   ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:21:54: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |                         if (r == N)ans = min(ans, max(0ll, sum - W));
      |                                                   ~~~^~~~~~~~~~~~~~