Constructing a DAG with Exactly K Paths from Node 1 to Node N

Правка en2, от MieAi., 2025-07-02 13:55:55

Guys, i need help with this problem from a offline contest i participated ;(

Construct a directed graph that sastified all the following conditions:

  • at most 1 edge between any pair of nodes

  • the graph must have at most 500,000 nodes and 1,000,000 edges

  • graph must be acyclic (no cycle)

  • must be exactly k ($$$k\le10^{100}$$$) distinct paths from node 1 to the node with largest index (node n)

Thank yall!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский MieAi. 2025-07-02 13:57:13 53
en2 Английский MieAi. 2025-07-02 13:55:55 17 Tiny change: 'exactly k distinct ' -> 'exactly k ($k<=10^100) distinct '
en1 Английский MieAi. 2025-07-02 13:53:26 543 Initial revision (published)