Shirlies
宁静专注认真的程序媛~
摘要: 晕,最基本的dp题,最长公共子序列。。。。。。竟然没有考虑到空格,衰衰地wa了几次。。。。。。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 const int maxn = 1010; 6 int dp[maxn][maxn]; 7 char s1[maxn]; 8 char s2[maxn]; 9 10 int main() 11 { 12 while(gets(s1) != NULL) 13 { 14 gets(s2); 15 int len1 阅读全文
posted @ 2012-04-07 16:20 Shirlies 阅读(404) 评论(0) 推荐(0) 编辑
摘要: (~ o ~)~zZ最长子序列。。。。。。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 6 struct box 7 { 8 int index; 9 int dm[12]; 10 }b[40]; 11 int num,dim; 12 int ins,maxn; 13 int dp[40]; 14 int record[40]; 15 int ans[40]; 16 17 bool cmp(const box 阅读全文
posted @ 2012-04-07 15:49 Shirlies 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 这一题题意理解起来有点困难,汗,这个对题目意思解释比较详细,我是看了这个题目解释才做出来的http://www.byywee.com/page/M0/S259/259491.htmlView Code 1 #include <cstdio> 2 #include <cstring> 3 4 int in[30]; 5 int right[30]; 6 int dp[30]; 7 int b[30]; 8 9 int main() 10 { 11 int n; 12 int a; 13 scanf("%d",&n); 14 for(int i 阅读全文
posted @ 2012-04-07 11:23 Shirlies 阅读(345) 评论(0) 推荐(0) 编辑