Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何找到索引 idx,使得 dist[idx] 最小,但仅在那些访问 [idx] 为 false 的人中?上下文用于 Dijkstra 算法的实现。
min((idx for idx in indexes if not visited[idx]), key=lambda idx: dist[idx])