摘要: Bessie喜欢在手机上下游戏玩,然而她蹄子太大,很难在小小的手机屏幕上面操作。 她被她最近玩的一款游戏迷住了,游戏一开始有n个正整数,(2<=n<=262144),范围在1-40。在一步中,贝西可以选相邻的两个相同的数,然后合并成一个比原来的大一的数(例如两个7合并成一个8),目标是使得最大的数最 阅读全文
posted @ 2019-05-03 11:14 Achen_sy 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 细节被坑惨 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e6+5; 4 const int INF=1e9+7; 5 int n,ans,dp[305][305]; 6 template <class t>vo 阅读全文
posted @ 2019-05-03 10:32 Achen_sy 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 够坑 记得开long long 优化:减少一维,将起点固定为1,枚举终点 f(i,j)=max(f(k,j-1)*num(k+1,i)) 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e6+5; 4 const 阅读全文
posted @ 2019-05-03 10:03 Achen_sy 阅读(150) 评论(0) 推荐(0) 编辑
摘要: f(i,j)=min(f(i-1,k)+f(k+1,j)+ai-1*ak*aj) k表示被抽取的数 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<vector> 5 #include<queue> 6 阅读全文
posted @ 2019-05-03 08:58 Achen_sy 阅读(142) 评论(0) 推荐(0) 编辑
摘要: f(i,j)=f(i+1,j-1)+2 or max(f(i,k)+f(k+1,j)) 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<vector> 5 #include<queue> 6 #incl 阅读全文
posted @ 2019-05-03 08:52 Achen_sy 阅读(101) 评论(0) 推荐(0) 编辑