搜索
Aoxuets
REM 是我的, 拔剑吧!
展开
-
CodeVs 1009
题意: 给出一个整数 n(n 规则: 一位数可变换成另一个一位数: 规则的右部不能为零。 例如:n=234。有规则(k=2): 2-> 5 3-> 6 上面的整数 234 经过变换后可能产生出的整数为(包括原数): 234 534 264 564 共 4 种不同的产生数问题: 给出一个整数 n 和 k 个规则。求出: 经过任意次的变换(0次或多次)原创 2016-03-14 10:53:55 · 277 阅读 · 0 评论 -
LightOJ1004
#include using namespace std; int Map[106][106]; int Vis[106][106]; int Num[106][106]; int T; const int step[2][2] = {1,0,0,1}; void Init() { memset(Map,0,sizeof(Map)); memset(Vis,原创 2016-03-14 10:55:57 · 258 阅读 · 0 评论 -
ZOJ 2110 DFS
狗要出门,且正好在T秒 就是DFS + 剪枝, 联系一下剪枝技巧 #include #include #include #include using namespace std; typedef long long ll; const int step[][2] = {0,1,0,-1,1,0,-1,0}; const int maxn = 10 + 7; char Map[m原创 2016-03-14 10:54:53 · 509 阅读 · 0 评论 -
ZOJ1008
题目:ZOJ 1008分析:重排矩阵, 虽然题目给的时间很多, 但是要注意剪枝, 把相同的矩阵标记, 在搜索时可以起到剪枝效果。Code:#include <bits/stdc++.h>using namespace std;struct Node { int left, right, top, buttom; bool operator == (const Node &a) con原创 2016-05-09 16:54:26 · 810 阅读 · 0 评论 -
Light OJ 1012
经典搜索水题...... #include using namespace std; const int maxn = 20 + 13; const int step[4][2] = {0,1,0,-1,1,0,-1,0}; bool Vis[maxn][maxn]; char Map[maxn][maxn]; int Num, N, M; void BFS(int x,原创 2016-03-14 10:59:45 · 371 阅读 · 0 评论