Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
struct edge{int to,cost;};
struct data{
    int pos,state;
    double cost;
    bool operator>(const data &d)const{
        return cost>d.cost;
    }
};
vector<edge>g[32];
const double INF=1e9+7;
double d[32][1024];
int t[16];
int n,m,p,a,b;
int main(){
    while(scanf("%d%d%d%d%d",&n,&m,&p,&a,&b),n||m||p||a||b){
        a--;b--;
        for(int i=0;i<m;i++){
            g[i].clear();
        }
        fill(dp[0],32*1024,INF);
        for(int i=0;i<n;i++)scanf("%d",&t[i]);
        for(int i=0;i<p;i++){
            int x,y,z;
            scanf("%d%d%d",&x,&y,&z);
            x--;y--;
            g[x].push_back((edge){y,z});
            g[y].push_back((edge){x,z});
        }
        priority_queue<data,vector<data>,greater<data> >Q;
        Q.push((data){a,0,0});
        while(Q.size()){
            data a=Q.top();Q.pop();
            if(d[a.pos][a.state]<a.cost)continue;
            d[a.pos][a.state]=a.cost;

            for(int i=0;i<g[a.pos].size();i++){
                edge &e=g[a.pos][i];
                for(int j=0;j<n;j++){
                    if((a.state>>j)&1)continue;
                    Q.push((data){e.to,a.state|(1<<j),a.cost+(double)e.cost/t[j]});
                }
            }
        }
        double mi=INF;
        for(int i=0;i<(1<<n);i++){
            mi=min(mi,d[b][i]);
        }
        if(mi==INF)puts("Impossible");
        else printf("%.6f\n",mi);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'dp' was not declared in this scope; did you mean 'p'?
   25 |         fill(dp[0],32*1024,INF);
      |              ^~
      |              p
a.cc:34:40: error: template argument 1 is invalid
   34 |         priority_queue<data,vector<data>,greater<data> >Q;
      |                                        ^
a.cc:34:40: error: template argument 2 is invalid
a.cc:34:54: error: template argument 1 is invalid
   34 |         priority_queue<data,vector<data>,greater<data> >Q;
      |                                                      ^
a.cc:34:56: error: template argument 1 is invalid
   34 |         priority_queue<data,vector<data>,greater<data> >Q;
      |                                                        ^
a.cc:34:56: error: template argument 2 is invalid
a.cc:34:56: error: template argument 3 is invalid
a.cc:35:11: error: request for member 'push' in 'Q', which is of non-class type 'int'
   35 |         Q.push((data){a,0,0});
      |           ^~~~
a.cc:35:17: error: reference to 'data' is ambiguous
   35 |         Q.push((data){a,0,0});
      |                 ^~~~
In file included from /usr/include/c++/14/vector:69,
                 from a.cc:3:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:8: note:                 'struct data'
    7 | struct data{
      |        ^~~~
a.cc:36:17: error: request for member 'size' in 'Q', which is of non-class type 'int'
   36 |         while(Q.size()){
      |                 ^~~~
a.cc:37:13: error: reference to 'data' is ambiguous
   37 |             data a=Q.top();Q.pop();
      |             ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:8: note:                 'struct data'
    7 | struct data{
      |        ^~~~
a.cc:37:30: error: request for member 'pop' in 'Q', which is of non-class type 'int'
   37 |             data a=Q.top();Q.pop();
      |                              ^~~
a.cc:38:20: error: request for member 'pos' in 'a', which is of non-class type 'int'
   38 |             if(d[a.pos][a.state]<a.cost)continue;
      |                    ^~~
a.cc:38:27: error: request for member 'state' in 'a', which is of non-class type 'int'
   38 |             if(d[a.pos][a.state]<a.cost)continue;
      |                           ^~~~~
a.cc:38:36: error: request for member 'cost' in 'a', which is of non-class type 'int'
   38 |             if(d[a.pos][a.state]<a.cost)continue;
      |                                    ^~~~
a.cc:39:17: error: request for member 'pos' in 'a', which is of non-class type 'int'
   39 |             d[a.pos][a.state]=a.cost;
      |                 ^~~
a.cc:39:24: error: request for member 'state' in 'a', which is of non-class type 'int'
   39 |             d[a.pos][a.state]=a.cost;
      |                        ^~~~~
a.cc:39:33: error: request for member 'cost' in 'a', which is of non-class type 'int'
   39 |             d[a.pos][a.state]=a.cost;
      |                                 ^~~~
a.cc:41:31: error: request for member 'pos' in 'a', which is of non-class type 'int'
   41 |             for(int i=0;i<g[a.pos].size();i++){
      |                               ^~~
a.cc:42:29: error: request for member 'pos' in 'a', which is of non-class type 'int'
   42 |                 edge &e=g[a.pos][i];
      |                             ^~~
a.cc:44:27: error: request for member 'state' in 'a', which is of non-class type 'int'
   44 |                     if((a.state>>j)&1)continue;
      |                           ^~~~~
a.cc:45:23: error: request for member 'push' in 'Q', which is of non-class type 'int'
   45 |                     Q.push((data){e.to,a.state|(1<<j),a.cost+(double)e.cost/t[j]});
      |                       ^~~~
a.cc:45:29: error: reference to 'data' is ambiguous
   45 |                     Q.push((data){e.to,a.state|(1<<j),a.cost+(double)e.cost/t[j]});
      |                             ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:8: note:                 'struct data'
    7 | struct data{
      |        ^~~~