Language: C++

\#include<bits/stdc++.h>
using namespace std;

const int inf=1e9;

int main(){
  ios::sync_with_stdio(false);
	cin.tie(0);
	int n,m,h,k;
	while(cin>>n>>m>>h>>k,n){
		vector<tuple<int,int,int,int> > v[101];
		for(int i=0;i<m;i++){
			int a,b,c,d,e;cin>>a>>b>>c>>d>>e;
			a--;b--;e--;
			v[a].push_back(make_tuple(b,c,d,e));
			v[b].push_back(make_tuple(a,c,d,e));
		}
		int s,t;cin>>s>>t;
		s--;t--;
		int p;cin>>p;
		int a[500],b[500];
		for(int i=0;i<p;i++){
			int l,d;cin>>l>>d;
			int now=0;
			for(int j=0;j<l;j++){
				int tmp;cin>>tmp;
				tmp--;
				now|=(1<<tmp);
			}
			a[i]=d;
			b[i]=now;
		}
		int dp[300][300];
		for(int i=0;i<300;i++)for(int j=0;j<300;j++)dp[i][j]=inf;
		dp[0][0]=0;
		for(int i=0;i<p;i++){
			for(int j=0;j<(1<<k);j++){
				dp[i+1][j|b[i]]=min(dp[i+1][j|b[i]],dp[i][j]+a[i]);
				dp[i+1][j]=min(dp[i+1][j],dp[i][j]);
			}
		}
		int ans=inf;
		for(int i=0;i<(1<<k);i++){
			if(dp[p][i]==inf)continue;
			int d[101];
			for(int j=0;j<n;j++)d[j]=inf;
			d[s]=0;
			priority_queue<tuple<int,int,int> > q;
			q.push(make_tuple(0,s,0));
			while(!q.empty()){
				int now=get<1>(q.top());
				int nowcost=-get<0>(q.top());
				int nowh=get<2>(q.top());
				q.pop();
				if(nowcost>d[now])continue;
				if(nowh>h)continue;
				for(int j=0;j<(int)v[now].size();j++){
					int next=get<0>(v[now][j]);
					int next_h=get<2>(v[now][j]);
					int next_cost=get<1>(v[now][j]);
					int cop=get<3>(v[now][j]);
					if(i&(1<<cop))next_cost=0;
					if(d[next]>d[now]+next_cost && nowh+next_h<=h){
						d[next]=d[now]+next_cost;
						q.push(make_tuple(-d[next],next,nowh+next_h));
					}
				}
			}
			ans=min(ans,d[t]+dp[p][i]);
		}
		if(ans==inf)cout<<-1<<endl;
		else cout<<ans<<endl;
	}
}


Compiler output:
a.cc:1:1: error: stray '\' in program
    1 | \#include<bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | \#include<bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | \#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'ios' has not been declared
    7 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin.tie(0);
      |         ^~~
a.cc:11:17: error: 'vector' was not declared in this scope
   11 |                 vector<tuple<int,int,int,int> > v[101];
      |                 ^~~~~~
a.cc:11:24: error: 'tuple' was not declared in this scope
   11 |                 vector<tuple<int,int,int,int> > v[101];
      |                        ^~~~~
a.cc:11:30: error: expected primary-expression before 'int'
   11 |                 vector<tuple<int,int,int,int> > v[101];
      |                              ^~~
a.cc:15:25: error: 'v' was not declared in this scope
   15 |                         v[a].push_back(make_tuple(b,c,d,e));
      |                         ^
a.cc:15:40: error: 'make_tuple' was not declared in this scope
   15 |                         v[a].push_back(make_tuple(b,c,d,e));
      |                                        ^~~~~~~~~~
a.cc:38:49: error: 'min' was not declared in this scope; did you mean 'main'?
   38 |                                 dp[i+1][j|b[i]]=min(dp[i+1][j|b[i]],dp[i][j]+a[i]);
      |                                                 ^~~
      |                                                 main
a.cc:48:25: error: 'priority_queue' was not declared in this scope
   48 |                         priority_queue<tuple<int,int,int> > q;
      |                         ^~~~~~~~~~~~~~
a.cc:48:46: error: expected primary-expression before 'int'
   48 |                         priority_queue<tuple<int,int,int> > q;
      |                                              ^~~
a.cc:49:25: error: 'q' was not declared in this scope
   49 |                         q.push(make_tuple(0,s,0));
      |                         ^
a.cc:49:32: error: 'make_tuple' was not declared in this scope
   49 |                         q.push(make_tuple(0,s,0));
      |                                ^~~~~~~~~~
a.cc:51:41: error: 'get' was not declared in this scope
   51 |                                 int now=get<1>(q.top());
      |                                         ^~~
a.cc:57:52: error: 'v' was not declared in this scope
   57 |                                 for(int j=0;j<(int)v[now].size();j++){
      |                                                    ^
a.cc:69:29: error: 'min' was not declared in this scope; did you mean 'main'?
   69 |                         ans=min(ans,d[t]+dp[p][i]);
      |                             ^~~
      |                             main
a.cc:71:29: error: 'cout' was not declared in this scope
   71 |                 if(ans==inf)cout<<-1<<endl;
      |                             ^~~~
a.cc:71:39: error: 'endl' was not declared in this scope
   71 |                 if(ans==inf)cout<<-1<<endl;
      |                                       ^~~~
a.cc:72:22: error: 'cout' was not declared in this scope
   72 |                 else cout<<ans<<endl;
      |                      ^~~~
a.cc:72:33: error: 'endl' was not declared in this scope
   72 |                 else cout<<ans<<endl;
      |                                 ^~~~