随笔分类 - 搜索:BFS
摘要:又重头开始刷kuangbin,有些题用了和以前不一样的思路解决。全部题解如下 点击每道题的标题即可跳转至VJ题目页面。 A-棋盘问题 棋子不能摆在相同行和相同列,所以我们可以依此枚举每一行,然后标记每一列是否走过,在此基础上进行DFS即可。 代码如下: B-Dungeon Master 题意就是给你
阅读全文
摘要:Problem Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走
阅读全文
摘要:Problem Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 1
阅读全文
摘要:Problem Description Suppose that you are an admiral of a famous naval troop. Our naval forces have got 21 battleships. There are 6 types of battleship
阅读全文
摘要:Problem Description The students of the HEU are maneuvering for their military training. The red army and the blue army are at war today. The blue arm
阅读全文
摘要:Problem Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return s
阅读全文
摘要:Problem Description The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from
阅读全文
摘要:Problem Description Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately.
阅读全文
摘要:Problem Description Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息: 密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0<=N<=5000)的正整数
阅读全文
摘要:题目连接:http://120.78.128.11/Contest.jsp?cid=221#H 题目都比较难,每道题都很经典,我也做的很慢,这篇博文算是个收录。具体题目题解点击下面超链接吧。 一、Bridged Marble Rings 二、转换地图 三、超级密码 四、Fliptile 五、Gap
阅读全文
摘要:Problem Description 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, an
阅读全文
摘要:Problem Description 在小白成功的通过了第一轮面试后,他来到了第二轮面试。面试的题目有点难度了,为了考核你的思维能量,面试官给你一副(2x4)的初态地图,然后在给你一副(2x4)的终态地图。每一幅地图都是有数字1~8表示,给你的地图的信息是一串序列,然后根据这序列,从地图的左上角开
阅读全文
摘要:Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to
阅读全文