首页| 论坛| 消息
主题:2^N的问题,怎么做才不会超时而且不会Output Limit Exceeded?
papayawing发表于 2006-09-26 23:19
题目是这样的:
Description
Each natural number is the sum of some powers of two. For example: 37=2^5+2^2+2^0. Now, we say a^b can be indicated like this: a(b), so 37=2(5)+2(3)+2(0). 5=2(2)+2(0), 3=2+2(0), so in the end 37=2(2(2)+2(0))+2(2)+2(0). We call this 0-2 Indicating Method.
Input
Each line contains only a number N(N
回帖(18):
18楼:不知道啦
17楼:。。。这个,不就是进制转换的变形么? 应该简单吧
16楼:先求出37=2(5)+2(2)+2(0)
然后看不在2和0中的,5表示为2(2)+2(0),这样就 ..

--> 全部回帖(18)»
最新回帖
收藏本帖
发新帖