2012年8月17日

nyoj58 最少步数

摘要: 1 #include<stdio.h> 2 int ans,sx,sy,ex,ey; 3 bool vis[9][9],map[9][9]={ 4 1,1,1,1,1,1,1,1,1, 5 1,0,0,1,0,0,1,0,1, 6 1,0,0,1,1,0,0,0,1, 7 1,0,1,0,1,1,0,1,1, 8 1,0,0,0,0,1,0,0,1, 9 1,1,0,1,0,1,0,0,1,10 1,1,0,1,0,1,0,0,1,11 1,1,0,1,0,0,0,0,1,12 1,1,1,1,1,1,1,1,113 };14 void dfs(int i,int j,in... 阅读全文

posted @ 2012-08-17 23:22 小花熊 阅读(308) 评论(0) 推荐(0) 编辑

poj1691 Painting A Board

摘要: 1 #include<cstring> 2 #include<iostream> 3 using namespace std; 4 struct node{ 5 int x1,y1,x2,y2,color; 6 }G[15]; 7 int n,ans,deg[15];//n表区域的个数,ans存储最终结果,deg存储拓扑图中各点的入度 8 bool vis[15],m[15][15];//vis用于标记是否访问过,m表示各点之间的联系 9 void buildG()//建立拓扑图,用于确定优先级 10 {11 for(int i=0;i<n;++i)12 ... 阅读全文

posted @ 2012-08-17 21:02 小花熊 阅读(419) 评论(0) 推荐(0) 编辑

导航