dulich2's blog

By dulich2, history, 15 months ago, In English

this problem: https://cses.fi/problemset/task/1196 can be solve by dijsktra and then you can keep a priority_queue for each node to memo k minimum paths, but I don't really understand how its work and even the complexity :v, can anyone explain for me :v

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
15 months ago, hide # |
Rev. 2  
Vote: I like it +3 Vote: I do not like it

Just keep at most k shortest distance to current node for each node instead of usual minimum distance, then run normal dijkstra with slight modification

Code