上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 83 下一页
摘要: 题目链接 "bzoj2111: [ZJOI2010]Perm 排列计数" 题解 序列大小关系构成树形小根堆关系 设f[i]表示大小为i的堆由多少种形态 那么f[n] = f[l] f[r] C(n 1,l),l,r为左右子数大小 对于每个n左子树的大小是一定的,可以处理出 组合数取膜要lucas 如 阅读全文
posted @ 2018-09-13 21:46 zzzzx 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P3959 宝藏" 题解 开始写了个random_shuffle竟然水了70,然后退火一下就A了? 每次做生成树的时候,随机两条边的顺序交换 退火一下,就A了 代码 c++ include include include include include inline int 阅读全文
posted @ 2018-09-13 21:44 zzzzx 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "hdu4035 Maze" 题解 f[u]表示在节点u通关的所需的边数期望 转移方程分叶子节点和非叶子点讨论 发现都可以化成f[x]=af[1]+bf[dad]+c的形式 然后推一下系数 还是看这个吧https://www.cnblogs.com/Paul Guderian/p/7624 阅读全文
posted @ 2018-09-13 21:40 zzzzx 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目链接 [hdu2899Strange fuction] 题解 发现这个东西是个凸的,直接三分 但我想写模拟退火... 代码 c++ include include include inline int read() { int x = 0,f = 1; char c = getchar(); w 阅读全文
posted @ 2018-09-13 15:28 zzzzx 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "pojA Star not a Tree?" 题解 啊,模拟退火是个好东西 模拟退火即可 代码 c++ include include include inline int read() { int x = 0,f = 1; char c = getchar(); while(c '9' 阅读全文
posted @ 2018-09-13 15:25 zzzzx 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luoguP3302 [SDOI2013]森林" 题解 本来这题树上主席树暴力启发式合并就完了 结果把lca写错了... 以后再也不这么写了 复杂度$O(nlog^2n)$ De了两个多小时....QAQ 代码 c++ include include include inline int 阅读全文
posted @ 2018-09-12 20:43 zzzzx 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P2657 [SCOI2009]windy数" 题解 我有了一种所有数位dp都能用记忆话搜索水的错觉 代码 阅读全文
posted @ 2018-09-12 20:36 zzzzx 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P4688 [Ynoi2016]掉进兔子洞" 题解 莫队维护bitset区间交个数 代码 阅读全文
posted @ 2018-09-12 20:32 zzzzx 阅读(148) 评论(0) 推荐(0) 编辑
摘要: "比赛链接" A 中位数(前缀和 二分) 额,确实没想到逼近... 然后写了n^2log的暴力,还CE了 只需要判断是否能有大于当前mid的中位数就好 这显然是可以二分的 代码 B 数数字(数位DP) 数位DP不会 不过yy一下,写个暴力dp,map转移似乎就...过了 代码 c++ include 阅读全文
posted @ 2018-09-09 22:00 zzzzx 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P2934 [USACO09JAN]安全出行Safe Travel" 题解 对于不在最短路树上的边(x, y) 1 | | t / \ / \ x y 考虑这样一种形态的图, ‘ ’ 标记为非最短路树的边 对于边集(x, t)内的任意一点 i, 到达它的所有方式一定是 1 t 阅读全文
posted @ 2018-09-08 16:44 zzzzx 阅读(224) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 83 下一页