摘要: 代码一: //背包问题 #include<iostream> #include<vector> #include<algorithm> using namespace std; struct node{ double w; double p; double t; }; int cmp(const n 阅读全文
posted @ 2019-02-09 17:15 Hello_World2020 阅读(240) 评论(0) 推荐(0) 编辑
摘要: vector非结构体,const不要忘了 #include<iostream> #include<algorithm> #include<vector> using namespace std; bool cmp(const int &x,const int &y){ return x>y; } i 阅读全文
posted @ 2019-02-09 15:23 Hello_World2020 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 最长公共子序列 //最长公共子序列(个数) #include<iostream> using namespace std; int c[100][100]={0}; int len1,len2; int gcd(string a,string b){ len1=a.length(); len2=b. 阅读全文
posted @ 2019-02-09 11:31 Hello_World2020 阅读(649) 评论(1) 推荐(0) 编辑