
搜索
文章平均质量分 79
aqk
这个作者很懒,什么都没留下…
展开
-
Red and Black
POJ - 1979 求最多到达的数量-->dfswa一次,二维数组输入长和宽反了,导致矩阵输入错误。有一个长方形的房间,覆盖了正方形的磁砖。每块磁砖的颜色,要么是红色,要么是黑色。一名男子站在一块黑色的磁砖上。他可以从一块磁砖移至相邻四块磁砖中的某一块。但是,他不允许在红色磁砖上移动,他只允许在黑色磁砖上移动。 编写一个程序,使得他允许重复上述的移动,判断他所能到达的黑色原创 2018-01-26 17:13:51 · 133 阅读 · 0 评论 -
Prime Ring Problem UVA - 524 回溯
A ring is composed of n (even number) circles as shown in diagram.Put natural numbers 1, 2, . . . , n into each circle separately, and thesum of numbers in two adjacent circles should be a prime.Note:...原创 2018-03-31 21:09:21 · 165 阅读 · 0 评论 -
Robot Motion POJ - 1573
A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (up the page...原创 2018-03-31 18:09:42 · 153 阅读 · 0 评论 -
Prime Path
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of sec...原创 2018-03-08 23:07:54 · 177 阅读 · 0 评论 -
Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th...原创 2018-03-08 19:29:34 · 133 阅读 · 0 评论 -
Find The Multiple
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there...原创 2018-03-08 18:52:09 · 124 阅读 · 0 评论 -
Catch That Cow POJ - 3278
在很久很久以前,有一位大师级程序员,实力高强,深不可测,代码能力无人能及。从来没有人听说过他的真名,只知道他在完成一段代码后,总会跟上一行注释“十四出品,必属精品”,于是他在编程江湖上便有了绰号“十四”。 然而,十四大师并不满足于现有的一切,他想要让自己的实力有更进一步的提升。为此,他专程前往二次元世界修行。 二次元旅程归来的十四大师学习了新的技能——闪现。原创 2018-02-05 01:27:33 · 277 阅读 · 0 评论 -
POJ 1321-棋盘问题(dfs)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 当为-1 -1时表示输入结束。原创 2018-02-05 00:01:28 · 156 阅读 · 0 评论 -
Dungeon Master
[POJ-2251]求最快的路径-->bfswa一次,Memory Limit Exceeded,超内存,由于忘记标记走过的点(vis数组),导致死循环,queue超内存。小技巧,可以将数组从i=1开始输入,初始化数组为“不能走”,可以不用判断边界。题目描述[NWUACM] 你被困在一个三维的空间中,现在要寻找最短路径逃生!空间由立方体单位构原创 2018-01-26 16:58:55 · 311 阅读 · 0 评论 -
八皇后问题 OpenJ_Bailian - 2698
[NWUACM] 在国际象棋棋盘上放置八个皇后,要求每两个皇后之间不能直接吃掉对方。 Input无输入。 Output按给定顺序和格式输出所有八皇后问题的解(见Sample Output)。 Sample OutputNo. 11 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 ...原创 2018-04-01 18:36:47 · 297 阅读 · 0 评论