随笔分类 -  POJ-递归

摘要:总时间限制: 1000ms 内存限制: 65536kB 描述 Consider a regular triangular area, divide it into four equal triangles of half height and remove the one in the middle 阅读全文
posted @ 2019-05-25 01:35 郭怡柔 阅读(489) 评论(0) 推荐(0)
摘要:总时间限制: 1000ms 内存限制: 65536kB 描述 在计算机上看到文件系统的结构通常很有用。Microsoft Windows上面的"explorer"程序就是这样的一个例子。但是在有图形界面之前,没有图形化的表示方法的,那时候最好的方式是把目录和文件的结构显示成一个"图"的样子,而且使用 阅读全文
posted @ 2019-05-24 23:03 郭怡柔 阅读(455) 评论(0) 推荐(0)
摘要:样例输出 解题思路 一开始看到这题就觉得要用栈,毕竟是表达式求值问题,但是自己的中缀表达式求值也没练过,而且这次的课程作业又是练习递归,于是就尝试了递归解法。 但是入门太浅,还是搞不懂递归思路,很难从一个表达式中进行结构的分解,逻辑梳理能力太差。 下面是大佬的代码,真心膜拜,希望我的代码能力能越来越 阅读全文
posted @ 2019-05-24 20:55 郭怡柔 阅读(308) 评论(0) 推荐(0)
摘要:题目链接: http://poj.org/problem?id=1191 解题思路: 关键是方程式的化简,思路清晰,整个题的难度不大。 AC代码(课程PPT) 阅读全文
posted @ 2019-05-24 19:57 郭怡柔 阅读(166) 评论(0) 推荐(0)
摘要:Description Some of you may have played a game called 'Blocks'. There are n blocks in a row, each box has a color. Here is an example: Gold, Silver, S 阅读全文
posted @ 2019-05-24 17:16 郭怡柔 阅读(327) 评论(0) 推荐(0)
摘要:Description The king pays his loyal knight in gold coins. On the first day of his service, the knight receives one gold coin. On each of the next two 阅读全文
posted @ 2019-05-24 11:09 郭怡柔 阅读(369) 评论(0) 推荐(0)
摘要:样例输出 解题思路: 由于第一个按钮是否按下会影响后面所有的按钮,因此枚举第一个按钮对应的两种情况。另外,如果按钮按下后和目标状态不相同,之前的情况已经枚举完毕,只需要按下下一个按钮即可。 代码: 阅读全文
posted @ 2019-05-23 19:41 郭怡柔 阅读(340) 评论(0) 推荐(0)
摘要:总时间限制: 5000ms 内存限制: 65536kB 描述 There is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks are yellow. Bo 阅读全文
posted @ 2019-05-23 16:52 郭怡柔 阅读(255) 评论(0) 推荐(0)
摘要:There are nine clocks in a 3*3 array (figure 1). The goal is to return all the dials to 12 o'clock with as few moves as possible. There are nine diffe 阅读全文
posted @ 2019-05-23 16:46 郭怡柔 阅读(289) 评论(0) 推荐(0)