Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. pt restrictie (a,b):
  2. ans[a] = 0
  3. for(int nn: g[a]) dfs(nn, a, b);
  4. ...
  5. void dfs(int nod, int prev, int b) {
  6. if (ans[nod] == 0 || dist(nod,b) < dist(prev,b)) return;
  7. ans[nod] = 0;
  8. for(int nn: g[nod]) dfs(nn, nod, b);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement