近期刷题题解

bzoj 2822 考虑最后一层放的方法,发现是Catlan数,python水过
http://paste.ubuntu.com/12394260/
bzoj 2427 强连通分量缩点+树形背包
http://paste.ubuntu.com/12394277/
bzoj 2438 强连通分量缩点后,发现只需要询问入度为0的点就可以得到答案,但如果新图中存在一个点,其在原图中代表的强连通分量大小为1,且出边中所有点的入度均大于1,这个点可以在最后一步不用询问
http://paste.ubuntu.com/12394292/
bzoj 1150 把每个点的权值处理成到下一个点的距离,转化为种树那道题,手写堆即可
http://paste.ubuntu.com/12394301/
bzoj 1149 奇怪的贪心,讨论一下每个节点的情况,详见代码
http://paste.ubuntu.com/12394308/
bzoj 1179 强连通分量缩点+spfa最长路
http://paste.ubuntu.com/12394314/
bzoj 1051 强连通分量缩点,当图中只存在一个出度为1的强连通分量时,答案为强连通分量大小,否则无解
http://paste.ubuntu.com/12394322/
bzoj 1028 爆搜,枚举对子,判断顺子和刻子
http://paste.ubuntu.com/12394325/
bzoj 2659 找规律
http://paste.ubuntu.com/12394330/
bzoj 3229 石子合并的神奇算法,用平衡树可优化至 O(nlogn)
http://paste.ubuntu.com/12394342/
bzoj 3594 DP穷举每一个位置应该升高多少,更新时用前缀最大值,需要二维树状数组优化,写下方程
f[i][j]=maxj1k=1,p<h[i]+jf[k][p]+1
http://paste.ubuntu.com/12394368/
bzoj 2208 正解或许是强连通分量缩点+DP,但暴力可过2333
http://paste.ubuntu.com/12394377/
bzoj 2729 组合数学,男生随便放,考虑女生和老师
http://paste.ubuntu.com/12394385
bzoj 1864 树形DP,思路很简单但却有很多细节
http://paste.ubuntu.com/12394394/
bzoj 1050 穷举最小边,然后做类似最小生成树的东西
http://paste.ubuntu.com/12394405/
bzoj 3170&&3210 切比雪夫距离转曼哈顿距离
max(xx0,yy0)=(x+y(x0+y0))+(xy)(x0y0))2
3170:http://paste.ubuntu.com/12394452/
3210:http://paste.ubuntu.com/12394455/
bzoj 2186 ans=ϕ(m!)n!m!=Πprimei|m!(11primei)n!
http://paste.ubuntu.com/12394472/
bzoj 1452 二维树状数组裸题
http://paste.ubuntu.com/12394476/
bzoj 2299&&2257 裴蜀定理
2299:http://paste.ubuntu.com/12394482/
2257:http://paste.ubuntu.com/12394486/
bzoj 2298 带权线段覆盖
http://paste.ubuntu.com/12394492/
bzoj 3293 同分糖果,处理一下套中位数
http://paste.ubuntu.com/12394495/
bzoj 2222 未发现正确解法,于是猥琐的从网上找了数据233
http://paste.ubuntu.com/12394499/
bzoj 3333 先权值线段树搞出每个点向后的逆序对数,然后进行重排就相当于减去一个数右方比它小的数所贡献的逆序对,这里线段树暴力即可,复杂度很科学(考虑每个点只被删一次)
http://paste.ubuntu.com/12394521/
bzoj 2286 虚树+DP,姑且当个模板
http://paste.ubuntu.com/12394523/
bzoj 4247 背包,把每个物品体积改成 1w[i]
http://paste.ubuntu.com/12394528/
bzoj 2111 转化一下发现这就是一个完全二叉树上的DP
http://paste.ubuntu.com/12394552/
bzoj 3680 模拟退火,当模板吧
http://paste.ubuntu.com/12394557/
bzoj 1078 人脑模拟发现,最后一次插入只可能出现在深度最浅的没有右儿子的节点(当它的左儿子是叶子时,就插入叶子),反向模拟即可
http://paste.ubuntu.com/12394584/
bzoj 3613 挺绕的,题目所求为差最大的满足较大值在前的二元组的差值/2
http://paste.ubuntu.com/12394595/
bzoj 1211 prufer编码 ans=(n2)!Πni=1(di1)! ,需要分解质因数去做
http://paste.ubuntu.com/12394619/
bzoj 3624 最小生成树,多求几遍就好了
http://paste.ubuntu.com/12394621/
bzoj 1197 DP, f[i][j] 为第i维,切割j次所得超平面个数, f[i][j]=f[i][j1]+f[i1][j1]
http://paste.ubuntu.com/12394629/
bzoj 1011 考虑到有误差,我们可以近似的按梯形面积去做
http://paste.ubuntu.com/12394634/
bzoj 1213 二分+python
http://paste.ubuntu.com/12394635/
bzoj 1190 按二进制幂数每层DP,层与层之间在进行转移,详见代码
http://paste.ubuntu.com/12394643/
bzoj 3172 AC自动机裸题
http://paste.ubuntu.com/12394649/
bzoj 3505 组合数学
http://paste.ubuntu.com/12394654/
bzoj 1858 巨恶心的线段树,下放懒惰标记时讨论一下
http://paste.ubuntu.com/12394660/
bzoj 2431 其实裸的DP就可过, f[i][j] 表示i个数的组合排列中逆序对有j个的个数 f[i][j]=ik=1f[i1][j(ik)]
http://paste.ubuntu.com/12394679/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值