Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106187 丁俊杰 二进制数问题 Python3 Accepted 39 MS 3756 KB 341 2025-01-15 16:36:03

Tests(1/1):


Code:

def ten_to_two(k): t1=0 t2=0 for i in k: res="" while i!=0: res+=str(i%2) i//=2 if res.count("1")>res.count("0"): t1+=1 else: t2+=1 return t1,t2 x=[] for i in range(1,1001): x.append(i) a=ten_to_two(x) print(a[0],a[1])