摘要: 湘大1492题,I, Robot(题目链接)。I, RobotDescriptionA robot must obey any orders given to it by human beings,except where such orders would conflict with the First Law.- Isaac AsimovThere is a robot trapped in the maze. Now you have to send out some instructions, telling it how to reach its destination.The .. 阅读全文
posted @ 2012-08-05 21:14 叶剑飞Victor 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 2011大纽约程序设计竞赛,D题 Decoding EDSAC Data(题目链接)。D ⋅ Decoding EDSAC DataThe world's first full-scale, stored-program, electronic, digital computer was the EDSAC (Electronic Delay Storage Automatic Calculator). The EDSAC had an accumulator-based instruction set, operating on 17-bit words(and 35-bit dou 阅读全文
posted @ 2012-08-05 20:55 叶剑飞Victor 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 中南大学2012暑期集训中期检测训练赛,第H题,跳跳(题目链接)。跳跳Description 一个每块地板标记着0~9某个数字的迷宫,其中标记1的地板不可以走,标记2~9的地板可以不花时间地跳到任意相同数字的位置,也可以和标记0的地板一样向前后左右任意方向花1个单位时间移动1的距离。给出起点和终点,求起点到终点的最短时间。Input 每组数据第一行一个n,表示尺寸,2 ≤ n ≤ 100。 接下来n行每行n个0~9的字符,或S表示起点,E表示终点,S和E的运动规则与0相同。整个地图只有一个S和一个E。Output 每组数据输出一个数,占一行,表示起点到终点可以花费的最短时间。 如... 阅读全文
posted @ 2012-08-04 22:24 叶剑飞Victor 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 湘大第1484题,Allocation of Memory(题目链接)。Allocation of MemoryDescription 科技发展的速度往往会超过最大胆的想象,盖茨先生很快就为自己的短视付出了代价。他开发的操作系统在内存管理上有重大局限,很快便不再适应个人计算机的飞速发展,所以他不得不请天才的你帮忙改写系统的内存管理模块。 系统里可以有若干个进程在同时运行,假设系统的总内存大小为M字节,从前到后依次编号为1至M。一开始的时候所有的内存都是可用的。如果在某个时刻某个进程需要使用k字节的内存,它就会向操作系统发出申请,系统会从前到后寻找连续的一段k字节的可用内存,将其分配给该... 阅读全文
posted @ 2012-07-15 22:26 叶剑飞Victor 阅读(454) 评论(0) 推荐(0) 编辑