摘要: 题目链接被以前的题目惯性思维了,此题dp[i][j],代表i到j这一段变成回文的最小花费。我觉得挺难的理解的。 1 #include 2 #include 3 #include 4 using namespace std; 5 int dp[2015][2015]; 6 char s1[2011]; 7 int hash[201]; 8 int main() 9 {10 int n,m,i,j,a,b;11 char ch[3];12 while(scanf("%d%d",&n,&m)!=EOF)13 {14 scanf("%s",s1) 阅读全文
posted @ 2013-07-08 16:54 Naix_x 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目链接调了一上午,单步的效率太低了,特别是在有递归的情况下。。。下午来了,输出调试了下,就发现bug了,各种混乱啊。比较高兴的事,1Y了。本来还准备用edge1优化一下的,结果完全没用到。。 1 #include 2 #include 3 #include 4 using namespace std; 5 struct node 6 { 7 int x1,y1,x2,y2,c; 8 } p[21]; 9 struct n1 10 { 11 int u,v,next; 12 } edge1[2000],edge2[2000]; 13 int first1... 阅读全文
posted @ 2013-07-08 14:07 Naix_x 阅读(290) 评论(0) 推荐(0) 编辑