
深度快速搜索(DFS)
深度快速搜索
☞十一
小z要发光
展开
-
Tempter of the Bone
点击打开链接The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized th原创 2017-07-31 16:33:19 · 182 阅读 · 0 评论 -
Fox And Two Dots
点击打开链接Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this:Each cell contains a dot that has some color. We will原创 2017-07-31 18:23:17 · 238 阅读 · 0 评论 -
素数环
点击打开链接素数环时间限制:1000 ms | 内存限制:65535 KB难度:2描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0输出每组原创 2017-08-01 20:49:22 · 1030 阅读 · 0 评论 -
2n皇后问题
点击打开链接题目描述给定一个n*n的棋盘,棋盘中有一些位置不能放皇后。现在要向棋盘中放入n个黑皇后和n个白皇后,使任意的两个黑皇后都不在同一行、同一列或同一条对角线上,任意的两个白皇后都不在同一行、同一列或同一条对角线上。问总共有多少种放法?输入输入的第一行为一个整数n,表示棋盘的大小。接下来n行,每行n个0或1的整数,如果一个整数为1,表示对应原创 2017-08-01 17:34:04 · 266 阅读 · 0 评论