题目链接 Flights for Regular Customers 首先按照$d$的大小升序排序 然后分成$m$个时刻,每条路径一次处理过来. $can[i][j]$表示当前时刻$i$能否走到$j$ $can$通过上一条路径后的$can$和当前的可行路径矩阵的$d$次幂得到. 这由$floyd$求解即可.考虑到$d$很大,用矩阵快速幂加速. TLE on test 10 矩阵乘法的时候用$bitset$优化. 更新答案的时候,我们枚举每个点. 若第$1$个点可以走到第$i$个点,则更新答案.…
In the country there are exactly n cities numbered with positive integers from 1 to n. In each city there is an airport is located. Also, there is the only one airline, which makes m flights. Unfortunately, to use them, you need to be a regular custo…