上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 1#include2#include3usingnamespacestd;4#definemax(a,b)a>b?a:b5structgoods{6intv;//价格7intp;//重要程度8intw;//v*p9}a[26];1011intdp[30001];1213intmain()14{15/... 阅读全文
posted @ 2013-04-21 21:30 YaLing 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1#include2#include3usingnamespacestd;4chara[100010];5boolb[100010];6voidfn(intn)7{8memset(b,false,sizeof(b));9if(n==1)cout>t;32while(t--)33{34cin>>n;3... 阅读全文
posted @ 2013-04-20 10:29 YaLing 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1#include2#include3#include4usingnamespacestd;5intJc[13]={0,1};6boolmark[13];7intmain()8{9//freopen("in.txt","r",stdin);10charch;11intk,i,j,s,t;12for(... 阅读全文
posted @ 2013-04-19 16:05 YaLing 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 状态迁移方程为:dp[i][j] += dp[i-1][j-k],dp[i][j]表示前i位数字的和为j,假设第i位数字为k,则前i为数字之和则为dp[i-1][j-k];(02usingnamespacestd;3intdp[11][82];4voidfn()5{6inti,j,k;7for(i=... 阅读全文
posted @ 2013-04-17 21:42 YaLing 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1//字典树的应用2#include3#include4#include5#include6#include7usingnamespacestd;89typedefstructphone{10structphone*num[10];11intcount;12}*Ph;1314Phroot;15int... 阅读全文
posted @ 2013-04-16 21:28 YaLing 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 守恒法--扩展阅读:http://www.cnblogs.com/dongsheng/archive/2013/03/04/2943206.html#include#includeusingnamespacestd;ints1[1001],s2[1001];intmain(){//freopen("... 阅读全文
posted @ 2013-04-15 19:28 YaLing 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1#include2#include3#include4usingnamespacestd;56typedefstructTri{7intid;8intl;9intw;10Tri():id(0),l(0),w(0){}11}Tri;12131415boolcmp(Tria,Trib)16{17ret... 阅读全文
posted @ 2013-04-13 02:27 YaLing 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1#include2#include3#include4#defineN265chars[11];6intmax;78typedefstructTrie{9Trie*next[N];//含有26个结点指针(a,b,c.......z)10intcount;11}*Node;1213Noderoot;... 阅读全文
posted @ 2013-04-11 22:57 YaLing 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1/*******************************************************2状态转移方程:3s1[i]==s2[j]时,same[i,j]=1;4ans=max(a[i][j]+same[i,j],a[i][j-1],a[i-1][j])56*********... 阅读全文
posted @ 2013-04-09 21:40 YaLing 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1#include2#include3#include4usingnamespacestd;5#definemax(a,b)a>b?a:b6intstack[100010]={-2},len[100010];7intmain()8{9intt,i,w,h,top;10longlongresult;1... 阅读全文
posted @ 2013-04-07 19:52 YaLing 阅读(236) 评论(1) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页