Language: C++

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#include<bits/stdc++.h>  
#define endl "\n"
using namespace std;
	typedef long long ll;
	const int maxn=105000;
	const int inf=0x3f3f3f3f;
	ll w[105];
	ll v[105];
	ll dp[105][maxn];
	ll n,m;
	int main(){
		IOS
		cin>>n>>m;
		for(int i=1;i<=n;i++)
			cin>>w[i]>>v[i];
		for(int i=1;i<=n;i++)
			for(int j=0;j<=m;j++)
				if(j+w[i-1]<=m)
					dp[j]=max(dp[j],dp[j+w[i-1]]+v[i-1]);
			
		ll ans=-1;
		for(int j=0;j<=m;j++)
			ans=max(ans,dp[j]);
		cout<<ans<<endl;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:50: error: no matching function for call to 'max(ll [105000], ll*)'
   20 |                                         dp[j]=max(dp[j],dp[j+w[i-1]]+v[i-1]);
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:2:
/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:20:50: note:   deduced conflicting types for parameter 'const _Tp' ('long long int [105000]' and 'll*' {aka 'long long int*'})
   20 |                                         dp[j]=max(dp[j],dp[j+w[i-1]]+v[i-1]);
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:20:50: note:   mismatched types 'std::initializer_list<_Tp>' and 'll*' {aka 'long long int*'}
   20 |                                         dp[j]=max(dp[j],dp[j+w[i-1]]+v[i-1]);
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:32: error: no matching function for call to 'max(ll&, ll [105000])'
   24 |                         ans=max(ans,dp[j]);
      |                             ~~~^~~~~~~~~~~
/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:24:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'll [105000]' {aka 'long long int [105000]'})
   24 |                         ans=max(ans,dp[j]);
      |                             ~~~^~~~~~~~~~~
/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
/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:24:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   24 |                         ans=max(ans,dp[j]);
      |                             ~~~^~~~~~~~~~~