题解 | 大整数哈希

大整数哈希

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)

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务