摘要: http://poj.org/problem?id=2531把第i个节点 放在A集合中 加上没有放在A集合中的节点与之相连的数值 减去已经放在A节点中与之相连的数值View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 int num[25][25],n,va[50],vb[50],ma,sum; 6 void dfs(int x,int sum) 7 { 8 int i; 9 va[x] = 1;10 for(i = 1 阅读全文
posted @ 2013-01-26 15:27 _雨 阅读(211) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1416乱七八糟的改,乱七八糟的错,最后过了样例 1A了 。对于每个分割开的数来说 有几种组合方式 搜下去View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #define INF 10000000 5 using namespace std; 6 int n,m,num[10],sum,g,vis[10],di,tt,mi,f; 7 char oo[10][10],o[10][10]; 8 void dfs(in 阅读全文
posted @ 2013-01-26 15:24 _雨 阅读(128) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3414六种情况 搜一下View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 struct node 6 { 7 int ca,cb; 8 int flag,num; 9 int op,ob; 10 }q[1000000]; 11 int a,b,c,vis[110][110],num[100000],g; 12 void put(int x,int y) 13 ... 阅读全文
posted @ 2013-01-26 08:25 _雨 阅读(170) 评论(0) 推荐(0) 编辑