Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#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()
using namespace std;
typedef long long ll;
typedef int Def;
//typedef int ll;
typedef pair<Def,Def> pii;
typedef vector<string> vs;
typedef vector<Def> vi;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#include<tuple>
#include<queue>
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
class DIJ{
public:
  struct edge {
    Def to,cost,tim,r;
  };
  vector<vector<edge> > G;
  Def n,L;
  Def d[110][25][300];////
 
  DIJ(Def size){
    n=size;
    G=vector<vector<edge> >(n);
  }
  void add_edge(Def a, Def b,Def c,Def d,Def e){///
    edge E={b,c,d,e},ee={a,c,d,e};///
    G[a].push_back(E);
    G[b].push_back(ee);
  }
  void dij(Def s){///
    rep(i,110)rep(j,25)rep(k,300)d[i][j][k]=inf;///
    d[s][0][0]=0;
 
    int p;cin>>p;
    vi pa(p);
    vi dd(p);
    rep(i,p){
      int l;cin>>l>>dd[i];
      int t=0;
      rep(j,l){
    int a;cin>>a;
    t|=1<<(a-1);
      }
      pa[i]=t;
    }
    rep(i,p)for(int j=255;j>=0;j--){
      d[s][0][j|pa[i]]=min(d[s][0][j|pa[i]],d[s][0][j]+dd[i]);
    }
     
    priority_queue<tp>q;
 
    rep(i,256)if(d[s][0][i]!=inf){
      q.push(tp(-d[s][0][i],s,0,i));
    }
    while(!q.empty()){
      Def cost,pos,tim,pas;
      tie(cost,pos,tim,pas)=q.top();
      cost*=-1;
      q.pop();
      //      cout<<pos<<" "<<tim<<" "<<pas<<" "<<cost<<endl;
      if(cost>d[pos][tim][pas])continue;
      rep(i,G[pos].size()){
    edge e=G[pos][i];
    Def to=e.to;
    Def ncost=cost;
    if(pas&(1<<e.r));
    else ncost+=e.cost;
     
    Def nt=tim+e.tim;
    if(ncost<d[to][nt][pas]&&nt<=24){
      d[to][nt][pas]=ncost;
      q.push(tp(-ncost,to,nt,pas));
    }
      }
       
    }
  }
  void solve(int s,int t,int h){
    dij(s);
    int out=inf;
    rep(i,h+1)rep(j,300)
      out=min(out,d[t][i][j]);
    if(out==inf)out=-1;
    cout<<out<<endl;
  }
};
 
int main(){
  int n,m,h,k;
  while(cin>>n>>m>>h>>k,n){
    DIJ dij(n);
    rep(i,m){
      int a,b,c,d,e;
      cin>>a>>b>>c>>d>>e;
      a--;b--;e--;
      dij.add_edge(a,b,c,d,e);
    }
    int s,t;cin>>s>>t;
    s--;t--;
    dij.solve(s,t,h);
     
  }
}


Compiler output:
a.cc:23:1: error: extended character   is not valid in an identifier
   23 |   struct edge {
      | ^
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |     Def to,cost,tim,r;
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |   };
      | ^
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |   vector<vector<edge> > G;
      | ^
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
   27 |   Def n,L;
      | ^
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
   28 |   Def d[110][25][300];////
      | ^
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
   29 |  
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
   30 |   DIJ(Def size){
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
   31 |     n=size;
      | ^
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
   32 |     G=vector<vector<edge> >(n);
      | ^
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
   33 |   }
      | ^
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |   void add_edge(Def a, Def b,Def c,Def d,Def e){///
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
   35 |     edge E={b,c,d,e},ee={a,c,d,e};///
      | ^
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:36:1: error: extended character   is not valid in an identifier
   36 |     G[a].push_back(E);
      | ^
a.cc:36:1: error: extended character   is not valid in an identifier
a.cc:36:1: error: extended character   is not valid in an identifier
a.cc:36:1: error: extended character   is not valid in an identifier
a.cc:37:1: error: extended character   is not valid in an identifier
   37 |     G[b].push_back(ee);
      | ^
a.cc:37:1: error: extended character   is not valid in an identifier
a.cc:37:1: error: extended character   is not valid in an identifier
a.cc:37:1: error: extended character   is not valid in an identifier
a.cc:38:1: error: extended character   is not valid in an identifier
   38 |   }
      | ^
a.cc:38:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
   39 |   void dij(Def s){///
      | ^
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
   40 |     rep(i,110)rep(j,25)rep(k,300)d[i][j][k]=inf;///
      | ^
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
   41 |     d[s][0][0]=0;
      | ^
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
   42 |  
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
   43 |     int p;cin>>p;
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
   44 |     vi pa(p);
      | ^
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
   45 |     vi dd(p);
      | ^
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
   46 |     rep(i,p){
      | ^
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
   47 |       int l;cin>>l>>dd[i];
      | ^
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
   48 |       int t=0;
      | ^
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
   49 |       rep(j,l){
      | ^
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character   is not valid in an identifier
   50 |     int a;cin>>a;
      | ^
a.cc:50:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character   is not valid in an identifier
a.cc:51:1: error: extended character   is not valid in an identifier
   51 |     t|=1<<(a-1);
      | ^
a.cc:51:1: error: extended character   is not valid in an identifier
a.cc:51:1: error: extended character   is not valid in an identifier
a.cc:51:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
   52 |       }
      | ^
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
   53 |       pa[i]=t;
      | ^
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
   54 |     }
      | ^
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
   55 |     rep(i,p)for(int j=255;j>=0;j--){
      | ^
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
   56 |       d[s][0][j|pa[i]]=min(d[s][0][j|pa[i]],d[s][0][j]+dd[i]);
      | ^
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
   57 |     }
      | ^
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character