题目链接:zoj 3471 Most Powerful很经典的状态dp,使用i的二进制位表示粒子的状态,0表示存在,1表示不存在。dp[i]表示在状态i的情况下能够释放的最大的能量,注意自身不能够发生碰撞。例如4个粒子的状态1100表示第0个和第1个粒子不存在,第2、3个粒子存在则可以转移到状态11...
分类:
其他好文 时间:
2014-10-06 20:57:30
阅读次数:
175
这题,找找规律,可以发现一个斐波那契数列。按照斐波那契数列求和,知道,SUM=Fn+2-F1,于是,该长度为Fn+2的倍数。因为斐波那契数列不一定是从1开始的,而从2开始的每个数都是从1开始的倍数。于是,只需求出最大的Fn+2是长度的倍数即可。#include #include #include u...
分类:
其他好文 时间:
2014-10-06 12:01:40
阅读次数:
284
Description
Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull problems related to string. And one day, moondy g...
分类:
其他好文 时间:
2014-10-05 15:19:28
阅读次数:
279
题目:有2中面条各n碗,每次抛硬币判断吃哪一种(到一种吃完为止),问抛硬币的数学期望。
分析:动态规划,概率dp。求出每种结束状态(即,有一种吃完)的概率,分别乘以步长即为期望。
大黄解法:状态位剩余的碗数,逆向求解,状态方程:
DP[ i ][ j ] = (DP[ i-1 ][ j ]+DP[ i ][ j-1 ])/2 + 1 ...
分类:
其他好文 时间:
2014-10-04 21:41:47
阅读次数:
193
Additive equations
Time Limit: 10 Seconds Memory Limit: 32768 KB
We all understand that an integer set is a collection of distinct integers. Now the question is: given an integer set, c...
分类:
其他好文 时间:
2014-10-04 19:29:37
阅读次数:
270
题目:ZOJ Problem Set - 3229 Shoot the Bullet
分类:有源有汇有上下界网络流
题意:有 n 天和 m 个girls,然后每天给一部分girls拍照,每个girls 有拍照的下限,即最少要拍这么多张,然后每天有k个女孩拍照,摄影师最多可以拍num张,然后 k 个女该每天拍照数量值有上下限,然后问你有没有满足这样条件的给女孩拍照的最大方案,然后...
分类:
其他好文 时间:
2014-10-04 18:04:06
阅读次数:
221
Treasure Map
Time Limit: 2 Seconds Memory Limit: 32768 KB
Your boss once had got many copies of a treasure map. Unfortunately, all the copies are now broken to many rectangular pieces, an...
分类:
其他好文 时间:
2014-10-04 13:42:37
阅读次数:
173
ZOJ 3609 Modular Inverse(扩展欧几里德)...
分类:
其他好文 时间:
2014-10-04 12:29:36
阅读次数:
197
总结起来自己还是太逗比,DP还是太弱,而DP却恰是算法思维能力的体现,现在要开始注重加强这方面的训练,遇到这类题目总是不敢想,令人担忧。Problem B ZOJ 3656 Bit Magichttp://acm.zju.edu.cn/onlinejudge/showProblem.do?probl...
分类:
其他好文 时间:
2014-10-04 05:09:06
阅读次数:
366