摘要: 1 #include 2 #include 3 using namespace std; 4 5 int ans; 6 char s[10005]; 7 char v[10005]; 8 9 void solve(int x) 10 { 11 if(!ans || v[ans] =s[x]) 18 { 19 v... 阅读全文
posted @ 2017-03-31 18:49 Posase 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1 //认真读题啊。。。。。。。。god。。。。 2 #include 3 #include 4 using namespace std; 5 6 int ans; 7 int v[3005]; 8 9 void solve(int x) 10 { 11 int i; 12 for(i=0; i= x) 14 { 15 ... 阅读全文
posted @ 2017-03-31 15:15 Posase 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 int ans; 6 int v[21]; 7 8 void solve(int x) 9 { 10 int t; 11 if(!ans || v[ans] > x) 12 v[++ans] = x; 13 else 14 { 1... 阅读全文
posted @ 2017-03-31 12:08 Posase 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1 //完全背包,可通过另一数组存重量的最大价值进行优化 2 #include 3 #define inf 1 bag[i]) 19 bag[i] = bag[i-r] + v; 20 } 21 22 int main() 23 { 24 int n,num,room,val; 25 cin >> n; 26 while(n--) 27 ... 阅读全文
posted @ 2017-03-31 12:07 Posase 阅读(148) 评论(0) 推荐(0) 编辑