Codeforces Round #320 (Div. 2) [Bayan Thanks-Round] A. Raising Bacteria | 书脊
Codeforces Round #320 (Div. 2) [Bayan Thanks-Round] A. Raising Bacteria
原题: http://codeforces.com/contest/579/problem/A
题目大意: 繁殖细菌, 细菌每天翻倍, 每天都可以添加任意个数的细菌. 问最后得到n个细菌, 需要加多少个细菌.
分析: 倍数增加, 就是二进制的1的个数, 每过一天, 前一天的细菌个数都增加 <<1 个, 所以找一下n中有几个1就可以了.
Read full article from Codeforces Round #320 (Div. 2) [Bayan Thanks-Round] A. Raising Bacteria | 书脊
No comments:
Post a Comment