摘要: 典型的搜索题目,将1,2,3,4...8填入上图A,B,C...H中,相邻的字母中的两个数不能相邻。现给定一种初始状态,求能否完成上述要求,若方案唯一,则依次输出完成后A,B,C...H中的数。View Code 1 #include <stdio.h> 2 #include <string.h> 3 #include <vector> 4 #define N 9 5 using namespace std; 6 vector<int> g[N]; 7 int a[N],vis[N],ans[N]; 8 void init() 9 {10 g[1 阅读全文
posted @ 2012-05-12 19:41 BeatLJ 阅读(291) 评论(0) 推荐(0) 编辑