Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя gkO_o

Автор gkO_o, история, 6 месяцев назад, По-английски

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

Полный текст и комментарии »

Теги dag, dp
  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится