上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 30 下一页

2014年11月1日

hdu1501 dp:两个字符串能否组成新串,状态表示能,不能。

摘要: dp思路最重要!! 1 #include 2 #include 3 char s1[1005],s2[1005],s[1005]; 4 int dp[1005][1005]; 5 int main() 6 { 7 int T,t,i,j,len1,len2; 8 scanf("%d"... 阅读全文

posted @ 2014-11-01 01:13 xiao_xin 阅读(152) 评论(0) 推荐(0) 编辑

2014年10月31日

hdu1505 dp:01矩形中最大面积全0矩阵

摘要: 被输入坑了233333另外感觉我这方法好像不太对的样子。。but找不到数据算了ac了== 1 #include 2 #include 3 #include 4 using namespace std; 5 int up[1005][1005],down[1005][1005],l1[1005][10... 阅读全文

posted @ 2014-10-31 22:48 xiao_xin 阅读(157) 评论(0) 推荐(0) 编辑

hdu1506 dp:长度不等的山峰找最大面积矩形(或者用单调栈)

摘要: 先用单调上升栈处理左右端点A了,稳稳地O(n)做法 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 stacks,s1; 7 int l[100005],r[100005],a[100005]; 8 int m... 阅读全文

posted @ 2014-10-31 19:38 xiao_xin 阅读(157) 评论(0) 推荐(0) 编辑

hdu1513 经典dp:添加最少字符使字符串回文:(滚动数组优化空间)

摘要: 一开始写了个无脑递归,MLE了。。 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[5005]; 6 int vis[5005][5005],n; 7 int dfs(int l,int r) 8 { 9 if... 阅读全文

posted @ 2014-10-31 17:46 xiao_xin 阅读(217) 评论(0) 推荐(0) 编辑

hdu1516 输出修改路径的dp:(优美的倒推)

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 char s1[1005],s2[1005]; 6 int dp[1005][1005]; 7 int main() 8 { 9 int len1,len2,i,j,t;10... 阅读全文

posted @ 2014-10-31 16:13 xiao_xin 阅读(166) 评论(0) 推荐(0) 编辑

2014年10月30日

hdu1520 简单树形dp

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int son[6005],dp[6005][3],father[6005],f[6005][6005],a[6005]; 7 void dfs(int x) ... 阅读全文

posted @ 2014-10-30 23:30 xiao_xin 阅读(70) 评论(0) 推荐(0) 编辑

hdu1545 dp[i][x][y]表示到i位,从i到之前1比0最多多x个,0比1最多多y个(注意边界)

摘要: T^T老是把转移方程方向想错 1 #include 2 #include 3 long long dp[75][15][15]; 4 int main() 5 { 6 int n,k,i,j,x,y; 7 long long sum; 8 while (~scanf("%... 阅读全文

posted @ 2014-10-30 19:31 xiao_xin 阅读(165) 评论(0) 推荐(0) 编辑

2014年10月28日

hdu4059 容斥定理+逆元(longlong计算分开写防溢出)

摘要: 1 #include 2 #include 3 #include 4 #define MOD 1000000007 5 long long x,tmp,s2,n; 6 long long a[105],vis[10005],prime[10005]; 7 void exgcd(long lon... 阅读全文

posted @ 2014-10-28 14:34 xiao_xin 阅读(147) 评论(0) 推荐(0) 编辑

2014年10月27日

hdu4055 dp[i][j]表示第i位以j结尾的方案数(long long 超时)

摘要: 1 #include 2 #include 3 #define MOD 1000000007 4 int dp[1005][1005],sum[1005][1005]; 5 char s[1005]; 6 int main() 7 { 8 int len,i,j; 9 while... 阅读全文

posted @ 2014-10-27 21:58 xiao_xin 阅读(144) 评论(0) 推荐(0) 编辑

2014年acm区域赛西安赛区总结

摘要: 2014年10月27日,于学校,翘了思修课。 随着西安赛区以打铁结束,这一年我的比赛已经全部告终,或者说已经被虐完。 如果大一还可以以年轻为借口,以机会还很多为自己的懒惰为借口,那这个时候,已经没有了任何借口。 西安赛区打得真的很好,没有了侥幸,没有了遗憾,对,实力就是那样。 正赛第一天,通神水题... 阅读全文

posted @ 2014-10-27 13:24 xiao_xin 阅读(277) 评论(0) 推荐(0) 编辑

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 30 下一页

导航