結果

問題 No.1966 Median of Divisors
ユーザー titiatitia
提出日時 2022-06-03 21:55:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 619 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 77,364 KB
最終ジャッジ日時 2023-10-21 01:50:03
合計ジャッジ時間 5,672 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,208 KB
testcase_01 AC 37 ms
53,208 KB
testcase_02 AC 54 ms
60,780 KB
testcase_03 AC 65 ms
65,604 KB
testcase_04 AC 563 ms
77,360 KB
testcase_05 AC 619 ms
77,112 KB
testcase_06 AC 600 ms
76,992 KB
testcase_07 AC 152 ms
76,784 KB
testcase_08 AC 437 ms
77,364 KB
testcase_09 AC 539 ms
77,356 KB
testcase_10 AC 551 ms
77,360 KB
testcase_11 AC 280 ms
77,080 KB
testcase_12 AC 344 ms
77,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
    
T=int(input())

for tests in range(T):
    N,M=map(int,input().split())

    x=pow(N,M,mod)


    ANS=x*(x+1)*pow(2,mod-2,mod)

    y=pow(N,M//2,mod)

    ANS-=y*(y+1)*(2*y+1)*pow(6,mod-2,mod)

    print(ANS%mod)
0