摘要: 题http://acm.hdu.edu.cn/showproblem.php?pid=4714题意: 给你一颗n个节点的树,你可以删除或者添加一些边,代价都是1。问:要把这棵树变成一个环,至少需要多少代价? 对于一颗树(子树),如果他的儿子数超过1,则需要改动,, 如... 阅读全文
posted @ 2016-08-13 19:30 伟大的蚊子 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题http://acm.hdu.edu.cn... 阅读全文
posted @ 2016-08-13 19:30 伟大的蚊子 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 题http://acm.hdu.edu.cn/showproblem.php?pid=3388题意:有三个正整数m, n, k, 求与m和n都互质第k个正整数(按从小到大排列)。一点废话: 讲m,n所以质因子提出,去重排序 求出mid中含这些因子的数的个数=ans,然... 阅读全文
posted @ 2016-08-13 14:51 伟大的蚊子 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 题http://acm.hdu.edu.cn... 阅读全文
posted @ 2016-08-13 14:51 伟大的蚊子 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 题http://codeforces.com/problemset/problem/27/E题意 给定一个正整数n,求一个最小的正整数,使得它的因子个数恰为n。保证答案不超过10^18大家应该都知道质因数分解这玩意: 任意数字可以分解成x=p[1]^a[1]*p[2]... 阅读全文
posted @ 2016-08-13 04:14 伟大的蚊子 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题http://codeforces.com... 阅读全文
posted @ 2016-08-13 04:14 伟大的蚊子 阅读(99) 评论(0) 推荐(0) 编辑
摘要: hdu5015n是#include#includeusing namespace std;typedef long long ll;const int P = 10000007;const int N=13;ll n,m;struct matrix{ ll a[... 阅读全文
posted @ 2016-08-13 02:11 伟大的蚊子 阅读(110) 评论(0) 推荐(0) 编辑
摘要: hdu5015n是#include#incl... 阅读全文
posted @ 2016-08-13 02:11 伟大的蚊子 阅读(107) 评论(0) 推荐(0) 编辑