摘要:
思路:快排+并查集#include<stdio.h>#include<algorithm>#define inf 999999using namespace std;struct node{ int s,e,w;}road[1005];int xx[1005];int cmp(node a,node b){ return a.w<b.w;}int find(int x){ while(x!=xx[x]) x=xx[x]; return x;}int main(){ int n,m; while(~scanf("%d%d",&n,& 阅读全文
posted @ 2011-11-27 21:58
skyming
阅读(256)
评论(0)
推荐(0)
摘要:
先写个暴搜+位运算的: 对于位运算的应用有所帮助,希望对于像偶一样的菜鸟有所帮助;这里对与位运算的理解还是 i 到 a[4][4] 的转换:举个例子吧: i=1 a[][]={0,0,0,0,0 0 0 0 ,0 0 0 0 ,0 0 0 1} 至于详细的思路参考:http://blog.sina.com.cn/s/blog_63509b890100pm7b.htmlView Code //poj 1753#include <iostream>#define MAX 0x7ffffffusing namespace std;int flip[16] = {0x13,0x27, 78 阅读全文
posted @ 2011-11-27 20:48
skyming
阅读(315)
评论(0)
推荐(0)

浙公网安备 33010602011771号