Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
66747 | 胡海峰老师 | 二进制数问题 | Python3 | Accepted | 28 MS | 3748 KB | 298 | 2024-03-10 14:05:20 |
def isClassA(n): cnt1 = 0 cnt0 =0 while n: b = n%2 n//=2 if b ==1: cnt1+=1 else: cnt0+=1 return cnt1>cnt0 a,b =0,0 for i in range(1,1001): if isClassA(i): a +=1 else: b +=1 print(a,b)