摘要: 这个问题其实并不难,主要是要采用合理的数据结构。我用的是数组,int mul[1000],并将每个元素限定在 unit = 100 即 100 进制。效率的确是有待改进,不过除非你要算宇宙的大小,否则耗时可以忽略不计。关键是简短易懂,可移植。[代码]上面的代码有个对0的打印问题(详见1楼),已进行修正:[代码] 阅读全文
posted @ 2010-04-05 23:48 长江西岸 阅读(1082) 评论(2) 推荐(1) 编辑
摘要: Crashing BalloonTime Limit: 1 Second Memory Limit: 32768 KB On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there a... 阅读全文
posted @ 2010-04-05 22:41 长江西岸 阅读(394) 评论(0) 推荐(1) 编辑
摘要: 抢整Time Limit: 1 Second Memory Limit: 8192 KB MSTCer热衷于抢整(抢整:在论坛上抢发编号为整数帖文章,对于论坛的某一个主题帖,按照发贴时间顺序,第一个帖子拥有编号1,第二个帖子拥有编号2,依此类推)。为了抢到整数N,许多MSTCer都发了贴,现在告诉你他们发贴的名单(已经按照发贴时间顺序排好),你能够找到谁抢到了整数N吗?这太容易了!但是现在麻烦来... 阅读全文
posted @ 2010-02-16 21:35 长江西岸 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Fire NetTime Limit: 1 Second Memory Limit: 32768 KB Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street o... 阅读全文
posted @ 2010-02-16 21:30 长江西岸 阅读(627) 评论(0) 推荐(1) 编辑