結果

問題 No.1844 Divisors Sum Sum
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-02-18 21:48:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 442 ms / 3,000 ms
コード長 528 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 77,132 KB
最終ジャッジ日時 2023-09-11 18:55:05
合計ジャッジ時間 9,755 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 431 ms
77,132 KB
testcase_01 AC 431 ms
76,708 KB
testcase_02 AC 436 ms
77,044 KB
testcase_03 AC 435 ms
76,988 KB
testcase_04 AC 437 ms
76,816 KB
testcase_05 AC 429 ms
76,932 KB
testcase_06 AC 434 ms
77,120 KB
testcase_07 AC 438 ms
77,116 KB
testcase_08 AC 442 ms
76,896 KB
testcase_09 AC 436 ms
76,860 KB
testcase_10 AC 406 ms
76,836 KB
testcase_11 AC 153 ms
76,952 KB
testcase_12 AC 336 ms
76,964 KB
testcase_13 AC 122 ms
77,032 KB
testcase_14 AC 199 ms
76,848 KB
testcase_15 AC 71 ms
71,224 KB
testcase_16 AC 70 ms
71,300 KB
testcase_17 AC 71 ms
71,204 KB
testcase_18 AC 73 ms
71,312 KB
testcase_19 AC 73 ms
71,288 KB
testcase_20 AC 74 ms
71,240 KB
testcase_21 AC 72 ms
71,344 KB
testcase_22 AC 72 ms
71,080 KB
testcase_23 AC 72 ms
71,296 KB
testcase_24 AC 74 ms
71,284 KB
testcase_25 AC 74 ms
71,204 KB
testcase_26 AC 73 ms
71,304 KB
testcase_27 AC 74 ms
71,100 KB
testcase_28 AC 73 ms
71,100 KB
testcase_29 AC 71 ms
71,168 KB
testcase_30 AC 72 ms
71,344 KB
testcase_31 AC 72 ms
71,312 KB
testcase_32 AC 72 ms
71,288 KB
testcase_33 AC 72 ms
71,216 KB
testcase_34 AC 69 ms
71,340 KB
testcase_35 AC 71 ms
71,088 KB
testcase_36 AC 72 ms
71,308 KB
testcase_37 AC 71 ms
71,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

それぞれの数について

(3* 2^0 + 2* 2^1 + 1* 2^2) = 3+4+4 = 11
(2* 3^0 + 1* 3^1) = 2+3 = 5

みたいにすればよい

Σ()

"""

import sys
from sys import stdin

mod = 10**9+7

def inv(x,mod):
    return pow(x,mod-2,mod)

def solve(e,P):

    N = e+1

    ret = P * ( pow(P,N,mod)-1 ) + N*(-P) + N
    ret *= inv( (P-1)**2 , mod )
    return ret % mod

L = int(stdin.readline())

ans = 1

for i in range(L):

    P,e = map(int,stdin.readline().split())
    ans *= solve(e,P)
    ans %= mod

print (ans % mod)
0