Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SuprDewd/CompetitiveProgramming
/ cmp
Class
cmp
code/graph/dijkstra.cpp:2–5 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
int *dist, *dad;
2
struct cmp {
3
bool operator()(int a, int b) const {
4
return dist[a] != dist[b] ? dist[a] < dist[b] : a < b; }
5
};
6
pair<int*, int*> dijkstra(int n, int s, vii *adj) {
7
dist = new int[n];
8
dad = new int[n];
Callers
1
cdiv
Function · 0.50
Calls
no outgoing calls
Tested by
1
cdiv
Function · 0.40