programmer group

Codeforces - 721c journey dynamic planning

At the beginning of this problem, I only introduced the equation of state transition, that is: dp[v][j]=min(dp[v][j],dp[u][j-1]+time[u][v]) But the loop is wrong, and the path will not save QAQ... After reading the big guy's code, it suddenly becomes bright Orz dp[i][j]: the minimum time to reach point I and pass through j cities pre[i][j]: arrive at point I and pass through the previous city of j cities After...