摘要: "vjudge" 题意 你有一张$n$点的无向图,每个点有一个点权$w_i$。图中原来存在一些边,你可以任意给这张图加上一些边。 记点$i$到点$1$的距离为$d_i$,你需要最小化$\sum_{i=1}^{n}(w_i d_i)^2$。 sol 第一次做$Topcoder$的题。。。 很像 "[H 阅读全文
posted @ 2018-04-05 22:33 租酥雨 阅读(323) 评论(0) 推荐(0) 编辑
摘要: "bzoj" sol 每天每座城市建一个点,该怎么连边就怎么连边,每次只需要在上一次的残余网络上跑最大流,所以复杂度不会太高。 code cpp include include include include using namespace std; int gi() { int x=0,w=1;c 阅读全文
posted @ 2018-04-05 22:31 租酥雨 阅读(171) 评论(0) 推荐(0) 编辑