题解 | 大整数哈希

大整数哈希

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

from os import initgroups
from sys import stdin
from collections import *
from heapq import *
from random import *
input = lambda: stdin.readline().strip()
# read1 = stdin.read().split()
# idx = 1

mod1 = 2**64
f = defaultdict(int)
ans = 0
for i in range(1,int(input())+1):
    x,y = map(int,input().split())
    ans += i*f[x]
    f[x] = y
    ans %= mod1
print(ans)

全部评论

相关推荐

链接
海梨花:我说话难听,你这简历跟没写没啥区别,搜搜别人的简历,用心写,不要随随便便就结束了
点赞 评论 收藏
分享
10-22 12:34
测试工程师
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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