ABC079 D: Wall

D - Wall

解き方

  • iを1にするための最小コストをWarshall Floydで求めてから計算

github.com