第一次做类似的题目,卡了好几天,最后看了爱酱的blog(http://blog.csdn.net/acm_cxlove/article/details/8679230)才会的,sad题意大概是这样,给你一个图,求起点1到N的最短时间,你有一双鞋子,可以加速,一次性花费0的时间行走M单位的路程,但是鞋...
分类:
其他好文 时间:
2014-07-21 10:00:38
阅读次数:
242
dp题目,dp[i][j]=1表示前i个数字形成的表达式的值除以K之后可以余j#include #include using namespace std;int dp[10001][101];int a[10001];int main(){ int m,n,k,u; while(cin>>m){ w...
分类:
其他好文 时间:
2014-07-21 09:39:06
阅读次数:
154
Description
Problem C: A Walk Through the Forest
Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to ...
分类:
其他好文 时间:
2014-07-21 09:27:14
阅读次数:
300
Problem Description
An equal sum partition of a sequence of numbers is a grouping of the numbers (in the same order as the original sequence) in such a way that each group has the same sum. For examp...
分类:
其他好文 时间:
2014-07-20 15:42:42
阅读次数:
256
Problem Description
There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can chan...
分类:
其他好文 时间:
2014-07-20 15:41:50
阅读次数:
213
题目:poj1157LITTLE SHOP OF FLOWERS
题意:假设以最美观的方式布置花店的橱窗,有 F 束花,每束花的品种都不一样,同时,至少有同样数量的花瓶,被按顺序摆成一行,花瓶的位置是固定的,并从左到右,从 1 到 V 顺序编号, V 是花瓶的数目,编号为 1 的花瓶在最左边,编号为 V 的花瓶在最右边,花束可以移动,并且每束花用 1 到 F 的整数惟一标识,标识花束...
分类:
其他好文 时间:
2014-07-20 10:33:09
阅读次数:
212
题意:求最长递增子序列
AC代码:#include
#include
#include
using namespace std;
int dp[1010],a[1010];
int main()
{
int i,j,n;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;...
分类:
其他好文 时间:
2014-07-20 10:28:31
阅读次数:
235
Problem Description
IP lookup is one of the key functions of routers for packets forwarding and classifying. Generally, IP lookup can be simplified as a Longest Prefix Matching (LPM) problem. That'...
分类:
其他好文 时间:
2014-07-20 10:18:28
阅读次数:
235
数塔
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 21314 Accepted Submission(s): 12808
Problem Description
在讲述DP算法的时候,一个经典的例子就是数塔问题,...
分类:
其他好文 时间:
2014-07-20 09:33:28
阅读次数:
196
一般情况:
[cpp]
view plaincopy
#include #include #include using namespace std; int a[1005],dp[1005],n; int LIS() { int i,j,ans,m; dp[1] = 1; ans = 1; for(i = 2...
分类:
其他好文 时间:
2014-07-20 09:28:19
阅读次数:
280