题解 | 大整数哈希
大整数哈希
https://www.nowcoder.com/practice/29f0cff8a69b4ab6a2f63fb7386defa3
n = int(input())
ans, dic = 0, dict()
for i in range(1,n+1):
x, y = map(int,input().split())
ans += i*dic.setdefault(x,0)
dic[x] = y
print(ans%2**64)
大整数哈希
https://www.nowcoder.com/practice/29f0cff8a69b4ab6a2f63fb7386defa3
n = int(input())
ans, dic = 0, dict()
for i in range(1,n+1):
x, y = map(int,input().split())
ans += i*dic.setdefault(x,0)
dic[x] = y
print(ans%2**64)
相关推荐
最喜欢秋天的火龙果很...:第一份工作一定要往大的去,工资低点没事。后面换工作会更好找,即使你去小公司,你也不可能不会换工作的。所以找大的去