摘要: 题目链接 "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) 编辑