Max Sum
Time Limit: 2000ms Memory limit: 32768K 有疑问?点这里^_^
题目描述
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-...
分类:
其他好文 时间:
2014-07-08 21:30:17
阅读次数:
205
http://acm.hdu.edu.cn/showproblem.php?pid=4722
大致题意:若一个整数的各位数字之和是10的倍数,称这个数为"good number"。给出区间[A,B],求出该区间内"good number"的数的个数。
第一道数位dp,折腾了半天才明白怎么回事。
设dp[site][mod]表示到第site位(由高位向低位)前面各位数字之和对1...
分类:
其他好文 时间:
2014-07-08 20:46:41
阅读次数:
223
题目来源:Light OJ 1316 1316 - A Wedding Party
题意:和HDU 4284 差不多 有一些商店 从起点到终点在走过尽量多商店的情况下求最短路
思路:首先预处理每两点之前的最短路 然后只考虑那些商店 个数小于15嘛 就是TSP问题 状态压缩DP搞一下 状态压缩姿势不对 有必要加强
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-07-08 19:37:07
阅读次数:
241
Cow Bowling
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 13464
Accepted: 8897
Description
The cows don't use actual bowling balls when they go bowling...
分类:
其他好文 时间:
2014-07-08 18:00:15
阅读次数:
230
推出了结论,万万没想到最后用搜索。。
还想dp来着。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll long long
#define N 1000005
ll prime[N],primenum;//有primen...
分类:
其他好文 时间:
2014-07-08 17:26:17
阅读次数:
214
Visual Studio 2013 与 14
如果
Install Visual Studio on the same computer as Visual Studio in 2013 "14" when CTP 14.0.21730.1 DP, a number of known issues.
While we expect that the Visual Stu...
分类:
其他好文 时间:
2014-07-08 16:09:04
阅读次数:
196
Cake
Time Limit: 1 Second
Memory Limit: 32768 KB
You want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for th...
分类:
其他好文 时间:
2014-07-08 15:36:15
阅读次数:
298
Unique Binary Search Trees
My Submissions
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 uniqu...
分类:
其他好文 时间:
2014-07-08 14:18:39
阅读次数:
159
http://acm.hdu.edu.cn/showproblem.php?pid=3652
大致题意:"B-number"即一个整数含有子串"13"且被13整除。求1-n之间这样的数的个数。
思路:有两个限制条件:含有子串“13”和能被13整除。那么设dp[site][mod][flag],表示到第site位对13取余为mod且标记为flag的数的个数。flag表示是否含有子...
分类:
其他好文 时间:
2014-07-08 13:43:12
阅读次数:
173
HDU 4778 Gems Fight!
题目链接
题意:有n个背包,包里有一些宝石,现在爱丽丝和你轮流选背包,把包里宝石丢到锅中,然后如果锅中有宝石数量到s个,就会得到魔法石,并且可以继续选背包,两人都按最优策略去取,问最后两人魔法石会差多少。
思路:dp,dp[s]表示选背包状态为s时候的值,然后去记忆化搜索即可,注意如果当前生成魔法石就继续加,否则就减即可
代码:...
分类:
其他好文 时间:
2014-07-08 12:56:53
阅读次数:
170