2013年8月16日
摘要: 水题 只要枚举两个水果 然后枚举两个水果各一个点 就可以构成直线 然后寻找经过直线的水果 只有一个水果的情况进行特判一下#include #include #include #include using namespace std;struct dat{ int x[15]; int y[15]; int sum;}a[15];int n;bool finds(int x1, int y1, int x2, int y2, int c){ int d[2]={0}; for(int i=0; i0) d[1]++; else ... 阅读全文
posted @ 2013-08-16 18:55 风流monkey 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 水题 最长公共子序列#include #include #include #include using namespace std;int dp[1010][1010],a[1010],b[1010];int n,m;int LCS(int x, int y){ if(x==-1 || y==-1) return 0; if(dp[x][y]!=-1) return dp[x][y]; if(a[x]==b[y]) return dp[x][y]=LCS(x-1, y-1)+1; else return dp[x][y]=max(LCS(x-... 阅读全文
posted @ 2013-08-16 11:09 风流monkey 阅读(144) 评论(0) 推荐(0) 编辑