結果

問題 No.1966 Median of Divisors
ユーザー titiatitia
提出日時 2022-06-03 21:56:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 612 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 77,260 KB
最終ジャッジ日時 2023-10-21 01:50:24
合計ジャッジ時間 5,676 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,144 KB
testcase_01 AC 38 ms
53,144 KB
testcase_02 AC 55 ms
60,716 KB
testcase_03 AC 65 ms
65,540 KB
testcase_04 AC 567 ms
77,192 KB
testcase_05 AC 612 ms
77,024 KB
testcase_06 AC 594 ms
76,916 KB
testcase_07 AC 150 ms
76,596 KB
testcase_08 AC 434 ms
77,192 KB
testcase_09 AC 540 ms
77,260 KB
testcase_10 AC 539 ms
77,196 KB
testcase_11 AC 282 ms
76,984 KB
testcase_12 AC 343 ms
76,992 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)
    y=pow(N,M//2,mod)
    print((x*(x+1)*pow(2,mod-2,mod)-y*(y+1)*(2*y+1)*pow(6,mod-2,mod))%mod)
0