CF960F Pathwalks
题目描述
给定 $n$ 个点 $m$ 条边的有向图,可能不连通,可能有重边,也可能会有自环。求最长的路径(可以经过重复节点),使得这条路径的编号和权值都**严格**单调递增,其中编号指输入的顺序。路径的长度是指经过边的数量。
输入格式
无
输出格式
无
说明/提示
The answer for the first sample input is $ 2 $ : . Note that you cannot traverse  because edge  appears earlier in the input than the other two edges and hence cannot be picked/traversed after either of the other two edges.
In the second sample, it's optimal to pick $ 1 $ -st, $ 3 $ -rd and $ 5 $ -th edges to get the optimal answer: .