2012年8月14日

poj1011 Sticks

摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 using namespace std; 6 bool anUsed[65]; 7 int L,N,stick[65]; 8 bool cmp(int a,int b) 9 {10 return a>b;11 }12 bool DFS(int nUnusedSticks,int nLeft)13 {14 int i,j,k;15 if(!(nUnusedSticks||nLe 阅读全文

posted @ 2012-08-14 21:10 小花熊 阅读(152) 评论(0) 推荐(0) 编辑

poj1161 Walls

摘要: 1 #include<cstdio> 2 #include<iostream> 3 #define MAX 0xfffffff 4 using namespace std; 5 int m,l; 6 int Area[201][251],G[201][201],People[251],Dist[31]; 7 int Init()//初始化数据 8 { 9 int i,j,k,t;10 for(i=1;i<=l;++i)11 {12 scanf("%d",&t);13 People[t]=i;14 }15 for(i=1... 阅读全文

posted @ 2012-08-14 19:38 小花熊 阅读(303) 评论(0) 推荐(0) 编辑

hdu1272 小希的迷宫

摘要: 1 #include<string.h> 2 #include<stdio.h> 3 int f[100010];//存放一个节点的父节点的编号 4 bool is[100010];//标志编号为I的房间是否存在 5 void exist(int x,int y)//判断x,y点是否已经存在 6 { 7 if(!is[x]){ 8 is[x]=1; 9 f[0]++;//统计房间个数 10 }11 if(!is[y]){12 is[y]=1;13 f[0]++;14 }15 ... 阅读全文

posted @ 2012-08-14 09:35 小花熊 阅读(260) 评论(0) 推荐(0) 编辑

导航