随笔分类 - 搜——索--bfs
摘要:1193: [HNOI2006]马步距离 Description 在国际象棋和中国象棋中,马的移动规则相同,都是走“日”字,我们将这种移动方式称为马步移动。如图所示, 从标号为 0 的点出发,可以经过一步马步移动达到标号为 1 的点,经过两步马步移动达到标号为 2 的点。任给 平面上的两点 p 和
阅读全文
摘要:Meteor Shower Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20463 Accepted: 5313 Description Bessie hears that an extraordinary meteor sh
阅读全文
摘要:定义一个二维数组: 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表示可以走的路,只能横着走或竖着走,不能斜着走,要
阅读全文
摘要:Leo has a grid with N rows and M columns. All cells are painted with either black or white initially. Two cells A and B are called connected if they s
阅读全文
摘要:胜利大逃亡(续) Problem Description Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置
阅读全文
摘要:Solitaire Problem Description Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from th
阅读全文
摘要:Ignatius and the Princess I Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty P
阅读全文
摘要:Tempter of the Bone Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maz
阅读全文
摘要:Treasure of the Chimp Island Problem Description Bob Bennett, the young adventurer, has found the map to the treasure of the Chimp Island, where the g
阅读全文
摘要:A计划 Problem Description 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑
阅读全文
摘要:Knight Moves Problem Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tou
阅读全文
摘要:Catch That Cow Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a
阅读全文
摘要:A strange lift Problem Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on
阅读全文
摘要:胜利大逃亡 Problem Description Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,
阅读全文
摘要:Rescue Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix.
阅读全文