题解 | #求最大连续bit数#
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
import re num = int(input()) bi = bin(num)[2:] print(len(max(re.findall('1+',bi))))
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
import re num = int(input()) bi = bin(num)[2:] print(len(max(re.findall('1+',bi))))
相关推荐