2
#Uses python3
import sys
def max_dot_product(a,b,n):
a = a.sort(reverse=True)
b = b.sort(reverse=True)
res = 0
for i in range(n):
res += a[i]*b[i]
return res
if __name__ == '__main__':
data = [int(x) for x in input("").split()]
n = data[0]
a = data[1:(n + 1)]
b = data[(n + 1):]
print(max_dot_product(a,b,n))
当我运行此代码时,它显示“TypeError:'NoneType'对象不是可以下载的”。Python:TypeError:'NoneType'object is not subcriptable
非常感谢! –