Please read the new rule regarding the restriction on the use of AI tools. ×

gkO_o's blog

By gkO_o, history, 6 months ago, In English

There are a total of $$$n$$$ delivery points in a delivery station, and these points are connected by $$$m$$$ one-way lanes.The delivery person cannot return to a station through a one-way lane. In other words, the $$$n$$$ delivery points form a directed acyclic graph. For a delivery point $$$u$$$, if the delivery person can travel from $$$u$$$ to any other point $$$v$$$ ($$$v$$$≠$$$u$$$), or from $$$v$$$ to $$$u$$$, then the station $$$u$$$ is considered a super delivery point. Please help calculate the number of super delivery points.

$$$n$$$, $$$m$$$ ≤ 3e5

Full text and comments »

Tags dag, dp
  • Vote: I like it
  • +16
  • Vote: I do not like it