摘要: 题目链接 "BZOJ2753" 题解 完了我连$kruskal$裸题都做不出来了。。 题目是求最小树形图,即有向图最小生成树 我们不能直接上$kruskal$,而要保证先加入前面的点, 所以我们排序的时候第一关键字改为高度即可 C++ include include include include 阅读全文
posted @ 2018-05-20 21:18 Mychael 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "BZOJ3533" 题解 我们设询问的向量为$(x_0,y_0)$,参与乘积的向量为$(x,y)$ 则有 $$ \begin{aligned} ans &= x_0x + y_0y \\ y &= \frac{x_0}{y_0}x + \frac{ans}{y_0} \\ \end{al 阅读全文
posted @ 2018-05-20 19:29 Mychael 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "BZOJ1407" 题解 枚举$m$用扩欧判即可 C++ include include include include include define REP(i,n) for (int i = 1; i 57){if (c == ' ') flag = 1; c = getchar() 阅读全文
posted @ 2018-05-20 14:56 Mychael 阅读(128) 评论(0) 推荐(0) 编辑