結果

問題 No.1844 Divisors Sum Sum
ユーザー chineristAC
提出日時 2022-02-18 22:25:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 376 ms / 3,000 ms
コード長 542 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 77,424 KB
最終ジャッジ日時 2024-06-29 09:16:56
合計ジャッジ時間 7,731 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

mod = 10**9 + 7

L = int(input())
res = 1
for _ in range(L):
    p,e = mi()

    ip = pow(p-1,mod-2,mod)
    res *= ip * (((p*(pow(p,e+1,mod)-1)%mod)*ip % mod)-(e+1)) % mod
    #print(ip * (((p*(pow(p,e+1,mod)-1)%mod)*ip % mod)-(e+1)))
    res %= mod

print(res)
0