哈希答案不正确

问题描述 投票:0回答:0

This is hacker what hacker rank says给定一个整数 n 和 n 个以空格分隔的整数作为输入,创建这些整数的元组 t 。然后计算并打印 hash(t) 的结果。 <--- this is the question.

n = int(input())
x = input().split() but 
x = tuple([eval(i) for i in x])
print(hash(x))

这是我的代码,对于 n =2 和 x = 1 2,问题的答案是 3713081631934410656,但我得到的是 -3550055125485641917。但是当值很大时hash不应该显示负值吗??

python hash tuples
© www.soinside.com 2019 - 2024. All rights reserved.