結果

問題 No.1844 Divisors Sum Sum
ユーザー tktk_snsntktk_snsn
提出日時 2022-02-18 22:23:09
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 573 ms / 3,000 ms
コード長 403 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 77,228 KB
最終ジャッジ日時 2023-09-11 19:29:54
合計ジャッジ時間 11,923 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 550 ms
77,228 KB
testcase_01 AC 572 ms
76,732 KB
testcase_02 AC 572 ms
76,960 KB
testcase_03 AC 573 ms
76,992 KB
testcase_04 AC 571 ms
76,744 KB
testcase_05 AC 568 ms
77,128 KB
testcase_06 AC 569 ms
76,840 KB
testcase_07 AC 571 ms
76,972 KB
testcase_08 AC 573 ms
77,056 KB
testcase_09 AC 571 ms
76,924 KB
testcase_10 AC 539 ms
76,972 KB
testcase_11 AC 181 ms
76,944 KB
testcase_12 AC 423 ms
77,096 KB
testcase_13 AC 134 ms
76,840 KB
testcase_14 AC 245 ms
77,204 KB
testcase_15 AC 73 ms
71,244 KB
testcase_16 AC 74 ms
71,504 KB
testcase_17 AC 73 ms
71,204 KB
testcase_18 AC 72 ms
71,208 KB
testcase_19 AC 73 ms
71,372 KB
testcase_20 AC 71 ms
71,376 KB
testcase_21 AC 74 ms
71,312 KB
testcase_22 AC 73 ms
71,484 KB
testcase_23 AC 73 ms
71,396 KB
testcase_24 AC 74 ms
71,344 KB
testcase_25 AC 73 ms
71,312 KB
testcase_26 AC 72 ms
71,512 KB
testcase_27 AC 72 ms
71,372 KB
testcase_28 AC 72 ms
71,260 KB
testcase_29 AC 72 ms
71,080 KB
testcase_30 AC 71 ms
71,204 KB
testcase_31 AC 73 ms
71,316 KB
testcase_32 AC 73 ms
71,364 KB
testcase_33 AC 77 ms
71,312 KB
testcase_34 AC 73 ms
71,480 KB
testcase_35 AC 71 ms
71,420 KB
testcase_36 AC 72 ms
71,572 KB
testcase_37 AC 74 ms
71,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
mod = 10 ** 9 + 7


def F(p, e):
    n = e + 1
    res = (pow(p, e + 1, mod) - 1) * pow(p - 1, mod - 2, mod) % mod
    res = p * res - e - 1
    res = res * pow(p - 1, mod - 2, mod) % mod
    return res


ans = 1
L = int(input())
for _ in range(L):
    p, e = map(int, input().split())
    ans = ans * F(p, e) % mod

print(ans)
0