上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: #include <iostream>#include <vector>#include <cstring>using namespace std;struct point{ int len; int pi,pj; //char str[31]; string str;};point p[101][101];int max(int x,int y){ return (x>y?x:y);}int main(int args,char** argv){ vector<string> vs1; vector<string> vs2; 阅读全文
posted @ 2012-02-03 15:58 wuzhibin 阅读(207) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1402dp 崩溃了,这题做得,虽然是一次过的,但是写边界条件太麻烦了,测试了好久。状态方程很直接/*This Code is Submitted by billforum for Problem 1402 at 2012-02-02 21:44:39*/#include <iostream>using namespace std;int d[51][51]={0},s[51][51][51]={0},p[51][51],q[51][51];int max(int x,int y){ return. 阅读全文
posted @ 2012-02-02 21:48 wuzhibin 阅读(187) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1760dp 最大字段和 d[i]=tmp+max(0,d[i-1]);/*This Code is Submitted by billforum for Problem 4000110 at 2012-02-02 17:36:05*/#include <iostream>#include <algorithm>#include <memory.h>using namespace std;int d[10001]={0};int max(int x,int y){ retur 阅读全文
posted @ 2012-02-02 17:39 wuzhibin 阅读(250) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1288dp,最长数字序列问题,f[i]记为序列长度为i的最小数字/*This Code is Submitted by billforum for Problem 1288 at 2012-02-02 10:47:48*/#include <iostream>using namespace std;int main(int args,char** argv){ int n,j; int np,ans,p[40001],f[40001]; cin>>n; ... 阅读全文
posted @ 2012-02-02 13:23 wuzhibin 阅读(209) 评论(0) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 4000104 at 2012-02-01 18:33:20*/#include <iostream>#include <cstring>using namespace std;int d[1001][1001];int max(int x,int y){ return (x>y?x:y);}int main(int args,char** argv){ char str1[1001],str2[1001]; while(cin>>str1>> 阅读全文
posted @ 2012-02-01 20:08 wuzhibin 阅读(174) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1058简单的dp/*This Code is Submitted by billforum for Problem 4000103 at 2012-02-01 18:08:39*/#include <iostream>using namespace std;int d[1001][1001];int max(int x,int y){ return (x>y?x:y);}int main(int args,char** argv){ int n; int tmp1,a... 阅读全文
posted @ 2012-02-01 18:12 wuzhibin 阅读(261) 评论(0) 推荐(1)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1956深搜+剪枝,与hoj 1049相似,此题固定了 筷子的长度和筷子的条数为4/*This Code is Submitted by billforum for Problem 1956 at 2012-01-31 17:30:00*/#include <iostream>#include <algorithm>using namespace std;struct point{ int num; int next;};point data[100];bool visit[100].. 阅读全文
posted @ 2012-01-31 17:33 wuzhibin 阅读(141) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1049经典的深搜+剪枝题,/*This Code is Submitted by billforum for Problem 1049 at 2012-01-31 17:05:44*/#include <iostream>#include <algorithm>using namespace std;struct point{ int num; int next;};point data[100];bool visit[100];int total,len,n;bool cmp(p.. 阅读全文
posted @ 2012-01-31 17:13 wuzhibin 阅读(225) 评论(0) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 2434 at 2012-01-30 17:11:48*/#include <iostream>#include <queue>#include <memory.h>using namespace std;struct point{ int length;//朋友的个数 int step; bool visit; int f[1001];//存放朋友的号码 int num;};point data[1001];bool kno... 阅读全文
posted @ 2012-01-30 17:19 wuzhibin 阅读(513) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=2706广搜,利用变量key来记录钥匙的种类,15代表有四把钥匙,0代表没有钥匙。此题特别的地方在于同一位置可能重复入队列,因为其拥有的钥匙会不同,所以用data[y][x][key]key代表其的钥匙状态。/*This Code is Submitted by billforum for Problem 2706 at 2012-01-29 19:39:56*/#include <iostream>#include <queue>using namespace std;int H,W; 阅读全文
posted @ 2012-01-30 12:55 wuzhibin 阅读(363) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页