按照题意,对每个数转成二进制之后再 reverse 之后,和原数进行比较
n = int(input())
a = list(map(int, input().split()))
res = 0
for val in a:
小 O 有一个长度为 n 的数组 a, 他现在想要选择其中一个数字进行"二进制翻转",他想知道有多少种方式使得反转后的数组总和比不操作的更大
Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册