library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub maspypy/library

:heavy_check_mark: graph/shortest_path/restore_path.hpp

Required by

Verified with

Code

vector<int> restore_path(vector<int> par, int t){
  vector<int> pth = {t};
  while (par[pth.back()] != -1) pth.eb(par[pth.back()]);
  reverse(all(pth));
  return pth;
}
#line 1 "graph/shortest_path/restore_path.hpp"
vector<int> restore_path(vector<int> par, int t){
  vector<int> pth = {t};
  while (par[pth.back()] != -1) pth.eb(par[pth.back()]);
  reverse(all(pth));
  return pth;
}
Back to top page