1205 - AB类数计数
Time Limit : 1 秒
Memory Limit : 128 MB
<span style="font-family:宋体;">若将一个正整数化为二进制数,在此二进制数中,我们将数字</span><span>1</span><span style="font-family:宋体;">的个数多于数字</span><span>0</span><span style="font-family:宋体;">的个数的这类二进制数称为</span><span>A</span><span style="font-family:宋体;">类数,否则就称其为</span><span>B</span><span style="font-family:宋体;">类数。</span>
<span><span> </span></span><span style="font-family:宋体;">例如:(</span><span>13</span><span style="font-family:宋体;">)</span><sub><span>10</span></sub><span>=</span><span style="font-family:宋体;">(</span><span>1101</span><span style="font-family:宋体;">)</span><sub><span>2</span></sub>
<span><span> </span><span> </span></span><span style="font-family:宋体;">其中</span><span>1</span><span style="font-family:宋体;">的个数为</span><span>3</span><span style="font-family:宋体;">,</span><span>0</span><span style="font-family:宋体;">的个数为</span><span>1</span><span style="font-family:宋体;">,则称此数为</span><span>A</span><span style="font-family:宋体;">类数;</span>
<span><span> </span><span> </span><span> </span></span><span style="font-family:宋体;">(</span><span>10</span><span style="font-family:宋体;">)</span><sub><span>10</span></sub><span>=</span><span style="font-family:宋体;">(</span><span>1010</span><span style="font-family:宋体;">)</span><sub><span>2</span></sub>
<span><span> </span><span> </span></span><span style="font-family:宋体;">其中</span><span>1</span><span style="font-family:宋体;">的个数为</span><span>2</span><span style="font-family:宋体;">,</span><span>0</span><span style="font-family:宋体;">的个数也为</span><span>2</span><span style="font-family:宋体;">,称此数为</span><span>B</span><span style="font-family:宋体;">类数;</span>
<span><span> </span><span> </span></span><span style="font-family:宋体;">(</span><span>24</span><span style="font-family:宋体;">)</span><sub><span>10</span></sub><span>=</span><span style="font-family:宋体;">(</span><span>11000</span><span style="font-family:宋体;">)</span><sub><span>2</span></sub>
<span><span> </span><span> </span></span><span style="font-family:宋体;">其中</span><span>1</span><span style="font-family:宋体;">的个数为</span><span>2</span><span style="font-family:宋体;">,</span><span>0</span><span style="font-family:宋体;">的个数为</span><span>3</span><span style="font-family:宋体;">,则称此数为</span><span>B</span><span style="font-family:宋体;">类数;</span>
<span><span> </span></span><span style="font-family:宋体;">程序要求:求出</span><span>1</span><span style="font-family:宋体;">~</span><span>1000</span><span style="font-family:宋体;">之中(包括</span><span>1</span><span style="font-family:宋体;">与</span><span>1000</span><span style="font-family:宋体;">),全部</span><span>A</span><span style="font-family:宋体;">、</span><span>B</span><span style="font-family:宋体;">两类数的个数。</span>
Input
Output
在同一行输出,空格分隔A、B两类数的个数。
Examples
Input
Output
Source
入门题-模拟