Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
vp po;
vi T;
int n,m,w,t;
void dfs(int now,int pre){
	rep(j,n)if((now&1<<j)==0){
		int to=now|1<<j;
		int q;
		if(pre+1)q=-abs(po[pre].first)-abs(po[pre].second)+abs(po[pre].first-po[j].first)+abs(po[pre].second-po[j].second)+abs(po[j].first)+abs(po[j].second);
		else q=2*(abs(po[j].first)+abs(po[j].second));
		T[to]=min(T[to],T[now]+q);
		dfs(to,j);
	}
}
int main(){
	cin>>n>>m>>w>>t;
	
	map<string,int>ma;//name -> weight value
	vp syo(m);
	rep(i,m){
		string a;
		int b,c;
		cin>>a>>b>>c;
		ma[a]=i;
		syo[i]=pii(b,c);
	}
	vvp in(n);
	po=vp(n);
	rep(i,n){
		int l;
		cin>>l>>po[i].first>>po[i].second;
		vp q(l);
		rep(j,l){
			string s;int b;
			cin>>s>>b;
			q[j]=pii(ma[s],b);
		}
		in[i]=q;
	}
	int N=1<<n;
	vi W(N);
	T=vi(N,inf);
	T[0]=0;
	loop(i,1,N){
		vi ne(m,inf);
		rep(j,n)if(i&1<<j){
			rep(k,in[j].size()){
				ne[in[j][k].first]=min(ne[in[j][k].first],in[j][k].second);
			}
		}
		rep(j,m)if(ne[j]!=inf)ne[j]=max(0,syo[j].second-ne[j]);
		else ne[j]=0;
		vi dp(w+1);
//		rep(j,m)cout<<" "<<ne[j];cout<<endl;
		rep(j,m)rep(k,w+1)if(k+syo[j].first<=w)dp[k+syo[j].first]=max(dp[k+syo[j].first],dp[k]+ne[j]);
//		int ma=0;
//		rep(j,w+1)ma=max(ma,dp[j]);
		W[i]=dp[w];
	}
	dfs(0,-1);
//	rep(i,N)cout<<W[i]<<" "<<T[i]<<endl;
	vi dp(t+1);
	loop(i,1,N)rep(j,t+1)if(j+T[i]<=t)dp[j+T[i]]=max(dp[j+T[i]],dp[j]+W[i]);
	cout<<dp[t]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:93:48: error: no matching function for call to 'max(int, long long int)'
   93 |                 rep(j,m)if(ne[j]!=inf)ne[j]=max(0,syo[j].second-ne[j]);
      |                                             ~~~^~~~~~~~~~~~~~~~~~~~~~~
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: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:93:48: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   93 |                 rep(j,m)if(ne[j]!=inf)ne[j]=max(0,syo[j].second-ne[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
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/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:93:48: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   93 |                 rep(j,m)if(ne[j]!=inf)ne[j]=max(0,syo[j].second-ne[j]);
      |                                             ~~~^~~~~~~~~~~~~~~~~~~~~~~