题解 | 大整数哈希

大整数哈希

https://www.nowcoder.com/practice/29f0cff8a69b4ab6a2f63fb7386defa3

n=int(input())

i=1
an=0
f={}
while i<=n:
    x,y=map(int,input().split())
    a=f.get(x,0)
    an+=i*a
    f[x]=y
    i+=1
print(an&((1<<64)-1))

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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