题解 | 牛牛的10类人
牛牛的10类人
https://www.nowcoder.com/practice/232b7fc32fac4636819e31a7d7c960a3
n = int(input())
l = list(map(int, input().split()))
s = []
for i in l:
x = ''
while i > 0:
y = i % 2
i = i // 2
x = x + str(y)
x = x[::-1]
shu1 = 0
shu0 = 0
for j in x:
if j == '1':
shu1 += 1
elif j == '0':
shu0 += 1
if shu1 % 2 == 0 and shu0 % 2 ==0 and shu1 != 0 and shu0 != 0:
s.append(10)
elif shu1 % 2 == 0 and shu1 != 0:
s.append(1)
elif shu0 % 2 == 0 and shu0 != 0:
s.append(0)
else:
s.append(100)
print(' '.join(map(str, s)))
OPPO公司福利 1077人发布