摘要: #include #include #include #include #include #include #include using namespace std; int n,m; const int maxn=1e4+2; const int maxm=5e4+2; int degree[maxn]; int fa[maxn]; struct edge{ int to; ... 阅读全文
posted @ 2018-06-16 21:44 shulin15 阅读(149) 评论(0) 推荐(0)
摘要: 【题意】 给定有n个点,m条边的无向图,没有平行边和自环,求从1到n的路径中,最长段的最小值(最短路不再是路径和,而是所有段中的最大值) 【AC】 阅读全文
posted @ 2018-06-16 16:32 shulin15 阅读(162) 评论(0) 推荐(0)
摘要: 去重!不然有环就直接挂掉了...0分 阅读全文
posted @ 2018-06-16 16:01 shulin15 阅读(169) 评论(0) 推荐(0)
摘要: 【AC】 阅读全文
posted @ 2018-06-16 15:18 shulin15 阅读(255) 评论(0) 推荐(0)
摘要: 【题意】 改编哈夫曼树,限制从左到右字母的编码按字典序递增 【思路】 因为是二进制编码,所以是二叉树; 因为是前缀码,所以每个字母都是叶子结点,不可能是内结点; 因为要按字典序递增,所以只能是相邻的结点结合,且排在前面的在左边,排在后面的在右边; 具有最优子结构性质:考虑f[i,j],可以由f[i, 阅读全文
posted @ 2018-06-16 11:12 shulin15 阅读(224) 评论(0) 推荐(0)