搜索
文章平均质量分 70
viva_la_vida__
这个作者很懒,什么都没留下…
展开
-
openjudge2815 城堡问题
描述 1 2 3 4 5 6 7 ############################# 1 # | # | # | | # #####---#####---#---#####---# 2 # # | # # # # # #---#####---#####---#####---原创 2017-03-29 10:22:57 · 254 阅读 · 0 评论 -
没过!poj 2488 a knight's journey
#include #include using namespace std; struct pos { int r,c; }; int visited[30][30]; pos path[30]; pos dir[8]={{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,-1},{2,1}}; int p,q; bool d原创 2017-04-18 14:39:51 · 138 阅读 · 0 评论 -
openjudge 4103 踩方格
描述 有一个方格矩阵,矩阵边界在无穷远处。我们做如下假设: a. 每走一步时,只能从当前方格移动一格,走到某个相邻的方格上; b. 走过的格子立即塌陷无法再走第二次; c. 只能向北、东、西三个方向走; 请问:如果允许在方格矩阵上走n步,共有多少种不同的方案。2种走法只要有一步不一样,即被认为是不同的方案。 输入 允许在方格上行走的步数n(n 输出原创 2017-04-14 17:10:02 · 430 阅读 · 0 评论 -
百练 POJ 1724 roads
描述 N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid for the road (expressed i原创 2017-04-16 09:30:33 · 347 阅读 · 0 评论 -
棋盘问题
#include #include #include #include using namespace std; const int maxn=8; char map[maxn][maxn]; int vis[100],n,k,ans; int flag; void dfs(int cur,int num) { if(num==k) {原创 2017-05-30 19:21:38 · 185 阅读 · 0 评论 -
bfs-catch that cow
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 10原创 2017-05-31 14:29:26 · 167 阅读 · 0 评论 -
n皇后
http://www.techiedelight.com/print-possible-solutions-n-queens-problem/ 蓝桥杯的题 也是看了别人代码写出来的 还有好几种解法 先这样吧 #include #include #include #include using namespace std; const int maxn=8; cha原创 2017-05-21 11:51:31 · 203 阅读 · 0 评论 -
Black And White HDU - 5113 dfs+剪枝
In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing a figure called a map, no more than four colors a原创 2018-01-17 10:48:13 · 143 阅读 · 0 评论