Problem 1982 --Give me the answer

1982: Give me the answer

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $3$ 正确数量 $3$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
Farmer John commanded his cows to search for different sets of numbers that sum to a given number.
The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers that
sum to 7:
1) 1+1+1+1+1+1+1
2) 1+1+1+1+1+2
3) 1+1+1+2+2
4) 1+1+1+4
5) 1+2+2+2
6) 1+2+4
Help FJ count all possible representations for a given integer N (1 <= N <= 1 ,000,000)

The first line of the input contains the number of test cases in the file. And t he first line of each case
contains one integer numbers n

For each test case, output a line with the ans % 1000000000.

1
7
6

推荐代码 查看1982 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$4 $ms] 淡意的温柔 590467 2020-06-04 15:30:56
内存最少[$3972 $KB] 淡意的温柔 590467 2020-06-04 15:30:56
第一AC 范晋豪@信息与计算科学142 108891 2017-07-02 23:10:47
第一挑战 范晋豪@信息与计算科学142 108891 2017-07-02 23:10:47

赛题来源/所属竞赛 20100831湖工大校赛 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛