Language: C++

#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int visited[31][31][31];
int d[31];

typedef struct edge
{
    int to, cost, limit;
    edge(int x, int y, int z): to(x), cost(y), limit(z) {}
} Edge;


typedef struct status {
    int from, to, speed;
    double time;
    status(int x, int x2, double y, int z): from(x), to(x2), time(y), speed(z) {}
} CurrentStatus;


struct cmp_statue {
    bool operator() (const CurrentStatus &a, const CurrentStatus &b) {
        return a.time > b.time;
    }
};


int main() {

    int ncities, nroads;
    int x, y, d, c;
    int start_index, end_index;

    while(scanf("%d%d", &ncities, &nroads) != EOF && !(ncities == 0 && nroads == 0)) {

        vector< vector<Edge> > path(ncities);
        memset(visited, 0, sizeof(visited));
        memset(d, 0, sizeof(d));

        // Input
        scanf("%d%d" , &start_index, &end_index);
        start_index--;
        end_index--;

        for(int n = 0; n < nroads; ++n) {
            scanf("%d%d%d%d", &x, &y, &d, &c);
            path[x - 1].push_back(Edge(y - 1, d, c));
            path[y - 1].push_back(Edge(x - 1, d, c));
        }


        double minimun_v = 0;
        for(int q = 0; q < nroads; ++q) {
            Edge *cs = NULL;
            int min = 1e9;
            for(int k = 0; k < ncities; ++k) {
                if(d[k] < min) {
                    cs = path[]
                }
            }

            if(cs.to == end_index) {
                if(cs.speed == 1) {
                    minimun_v = cs.time;
                    break;
                } else {
                    continue;
                }
            }

            if(cs == NULL) break;
            if(visited[cs.from][cs.to][cs.speed]) continue;

            visited[cs.from][cs.to][cs.speed] = 1;

            for(int j = 0; j < path[cs.to].size(); ++j) {
                int next_pt = path[cs.to][j].to;
                int limit = path[cs.to][j].limit;
                if(next_pt == cs.from) continue;

                for(int z = -1; z <= 1; ++z) {
                    int new_speed = cs.speed + z;
                    if(!visited[cs.to][next_pt][new_speed] && new_speed > 0 && new_speed <= limit) {
                        Q.push(CurrentStatus(cs.to, next_pt, cs.time + ((double)path[cs.to][j].cost)/new_speed, new_speed));
                    }
                }
            }
        }

        if(minimun_v) {
            printf("%0.5lf\n", minimun_v);
        } else {
            printf("unreachable\n");
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   41 |         memset(d, 0, sizeof(d));
      |                ^
      |                |
      |                int
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
a.cc:60:21: error: invalid types 'int[int]' for array subscript
   60 |                 if(d[k] < min) {
      |                     ^
a.cc:61:31: error: expected primary-expression before ']' token
   61 |                     cs = path[]
      |                               ^
a.cc:65:19: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   65 |             if(cs.to == end_index) {
      |                   ^~
a.cc:66:23: error: request for member 'speed' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   66 |                 if(cs.speed == 1) {
      |                       ^~~~~
a.cc:67:36: error: request for member 'time' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   67 |                     minimun_v = cs.time;
      |                                    ^~~~
a.cc:75:27: error: request for member 'from' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   75 |             if(visited[cs.from][cs.to][cs.speed]) continue;
      |                           ^~~~
a.cc:75:36: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   75 |             if(visited[cs.from][cs.to][cs.speed]) continue;
      |                                    ^~
a.cc:75:43: error: request for member 'speed' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   75 |             if(visited[cs.from][cs.to][cs.speed]) continue;
      |                                           ^~~~~
a.cc:77:24: error: request for member 'from' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   77 |             visited[cs.from][cs.to][cs.speed] = 1;
      |                        ^~~~
a.cc:77:33: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   77 |             visited[cs.from][cs.to][cs.speed] = 1;
      |                                 ^~
a.cc:77:40: error: request for member 'speed' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   77 |             visited[cs.from][cs.to][cs.speed] = 1;
      |                                        ^~~~~
a.cc:79:40: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   79 |             for(int j = 0; j < path[cs.to].size(); ++j) {
      |                                        ^~
a.cc:80:39: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   80 |                 int next_pt = path[cs.to][j].to;
      |                                       ^~
a.cc:81:37: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   81 |                 int limit = path[cs.to][j].limit;
      |                                     ^~
a.cc:82:34: error: request for member 'from' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   82 |                 if(next_pt == cs.from) continue;
      |                                  ^~~~
a.cc:85:40: error: request for member 'speed' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   85 |                     int new_speed = cs.speed + z;
      |                                        ^~~~~
a.cc:86:36: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   86 |                     if(!visited[cs.to][next_pt][new_speed] && new_speed > 0 && new_speed <= limit) {
      |                                    ^~
a.cc:87:25: error: 'Q' was not declared in this scope
   87 |                         Q.push(CurrentStatus(cs.to, next_pt, cs.time + ((double)path[cs.to][j].cost)/new_speed, new_speed));
      |                         ^
a.cc:87:49: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   87 |                         Q.push(CurrentStatus(cs.to, next_pt, cs.time + ((double)path[cs.to][j].cost)/new_speed, new_speed));
      |                                                 ^~
a.cc:87:65: error: request for member 'time' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   87 |                         Q.push(CurrentStatus(cs.to, next_pt, cs.time + ((double)path[cs.to][j].cost)/new_speed, new_speed));
      |                                                                 ^~~~
a.cc:87:89: error: request for member 'to' in 'cs', which is of pointer type 'Edge*' {aka 'edge*'} (maybe you meant to use '->' ?)
   87 |                         Q.push(CurrentStatus(cs.to, next_pt, cs.time + ((double)path[cs.to][j].cost)/new_speed, new_speed));
      |                                                                                         ^~