結果

問題 No.1844 Divisors Sum Sum
ユーザー asumo0729
提出日時 2022-02-18 21:58:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 514 ms / 3,000 ms
コード長 805 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 97,920 KB
最終ジャッジ日時 2024-06-29 08:51:12
合計ジャッジ時間 10,023 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect
import math
import itertools
import copy

stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
inf = float('inf')
mod = 10 ** 9 + 7
#mod = 998244353
eps = 1e-9
sortkey1 = itemgetter(0)
sortkey2 = lambda x: (x[0], x[1])

###############################################################

L = ip()
primes = [lp() for _ in range(L)]
ans = 1
for p, e in primes:
    x = pow(p, e + 2, mod) - 1
    y = pow(p - 1, mod - 2, mod)
    res = (x * y - (e + 2)) * y
    res %= mod
    ans *= res
    ans %= mod

print(ans)
0