|
|
back to boardI get WA11 before . Now I AC . Here is some hint ------------------------------------------------------------- WA11 code used[u]=true; for(int j=1;j<=n;j++) if(used[j]) f[j][u]=max(f[j][pre[u]],map[pre[u]][u]); -------------------------------------------------------------- AC code for(int j=1;j<=n;j++) if(used[j]) f[j][u]=max(f[j][pre[u]],map[pre[u]][u]); used[u]=true; -------------------------------------------------------------- Take care of details. -------------------------------------------------------------- Helpful test data: 6 6 1 2 8 2 3 3 3 5 2 2 4 7 4 6 2 2 5 6 Ans: Cost: 22 Cost: 25 |
|
|