You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i].
Given two nodes start and end, find the path with the maximum probability of success to go from start to end and return its success probability.
If there is no path from start to end, return 0. Your answer will be accepted if it differs from the correct answer by at most 1e-5.
 
Example 1:

Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.2], start = 0, end = 2
Output: 0.25000
Explanation: There are two paths from start to end, one having a probability of success = 0.2 and the other has 0.5 * 0.5 = 0.25.

Example 2:

Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.3], start = 0, end = 2
Output: 0.30000

Example 3:

Input: n = 3, edges = [[0,1]], succProb = [0.5], start = 0, end = 2
Output: 0.00000
Explanation: There is no path between 0 and 2.

 
Constraints:

2 <= n <= 10^4
0 <= start, end < n
start != end
0 <= a, b < n
a != b
0 <= succProb.length == edges.length <= 2*10^4
0 <= succProb[i] <= 1
There is at most one edge between every two nodes.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

def _disabled_input(*args, **kwargs):
    raise RuntimeError("input() is disabled in callable mode")
builtins.input = _disabled_input

ns = {"__name__": "__judge__"}  # prevent if __name__ == "__main__" blocks
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "class Solution:\n    def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float:\n        # undirected graph\n        # weighted positive edges\n        # single start\n        \n        # shortest path <-> longest path\n        \n        # 最短路 正边权 稀疏图 -》 stack dijkstra\n\n        N = 100010\n        dist = [2 for i in range(N)] \n        seen = set()\n        \n        h = [-1 for i in range(N)]\n        e = {}\n        ne = {}\n        w = {}\n        idx = 0\n        \n        # build singly linked list graph\n        def add(a, b, c, idx):\n            e[idx], w[idx] = b, c\n            ne[idx] = h[a] \n            h[a] = idx\n            \n        for edge, prob in zip(edges, succProb):\n            add(edge[0], edge[1], prob, idx)\n            idx += 1\n            add(edge[1], edge[0], prob, idx)\n            idx += 1\n        \n        \n        def heap_dijkstra():\n            dist[start] = 1\n            heap = []\n            heapq.heappush(heap, (-1, start))\n\n            while heap:\n                t = heapq.heappop(heap)\n                vertex, distance = t[1], -t[0]\n                if vertex in seen:\n                    continue\n                    \n                seen.add(vertex)\n                    \n                i = h[vertex] # idx\n                while i != -1:\n                    j = e[i]\n                    if dist[j] == 2 or dist[j] < distance * w[i]:\n                        dist[j] = distance * w[i]\n                        heapq.heappush(heap, (-dist[j], j))\n\n                    i = ne[i]\n            return dist[end]\n        \n        '''\n        graph = [[1e-6 for i in range(N)] for j in range(N)]\n\n        for edge, prob in zip(edges, succProb):\n            graph[edge[0]][edge[1]] = max(prob, graph[edge[0]][edge[1]])   \n            graph[edge[1]][edge[0]] = max(prob, graph[edge[1]][edge[0]])            \n        \n        def dijkstra():\n            dist[start] = 1\n            \n            for i in range(n):\n                t = -1\n                for j in range(n):\n                    if not seen[j] and (t == -1 or dist[t] < dist[j]):\n                        t = j\n                \n                seen[t] = True\n                for j in range(n):\n                    dist[j] = max(dist[j], dist[t] * graph[t][j])\n            \n            return dist[end]\n        \n        '''\n        \n\n        \n        output = heap_dijkstra()\n\n        if output == 2 or output < 1e-5:\n            return 0.0\n        else:\n            return output"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

_target = None
_fn_name = 'maxProbability'
if _fn_name:
    if "Solution" in ns:
        try:
            _obj = ns["Solution"]()
            if hasattr(_obj, _fn_name):
                _target = getattr(_obj, _fn_name)
        except Exception:
            _target = None
    if _target is None and _fn_name in ns and callable(ns[_fn_name]):
        _target = ns[_fn_name]
# Fallback: if there's exactly one user-defined function, use it
if _target is None:
    _cands = [v for k, v in ns.items() if callable(v) and getattr(v, "__module__", "") in ("__judge__", "__main__")]
    _user_funcs = [c for c in _cands if getattr(c, "__name__", "").startswith("_") is False]
    if len(_user_funcs) == 1:
        _target = _user_funcs[0]
if _target is None:
    raise RuntimeError(f"Could not resolve callable '{_fn_name}'")

_raw = sys.stdin.read().strip()
if _raw:
    _parsed = json.loads(_raw)
    if isinstance(_parsed, dict):
        _kwargs = _parsed.get("kwargs", {})
        _args = _parsed.get("args", [])
    else:
        _args, _kwargs = _parsed, {}
else:
    _args, _kwargs = [], {}
if not isinstance(_args, (list, tuple)):
    _args = [_args]
_res = _target(*_args, **_kwargs)
try:
    sys.stdout.write(repr(_res) + "\n")
except Exception:
    pass

```

Measured memory_bytes: 1610710