摘要:
Codeforces 437B 题意:在1到limit之间找最少个数,使得他们的lowbit总和等于sum。 先求出全部的lowbit()进行排序,然后扫一遍即可。 Codeforces 437C 题意:n个部分,m个连接线,拆某根线需要花费能量,为其两端连接部分的能量值中的较小值。求要把所有连接线 阅读全文
摘要:
因为CodeForces 437B这道题,接触到了lowbit。 先写一下函数: 以及原题上给出的定义: lowbit(x) equals 2k where k is the position of the first one in the binary representation of x. F 阅读全文