結果

問題 No.1966 Median of Divisors
ユーザー ニックネームニックネーム
提出日時 2022-06-03 22:13:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,332 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,660 KB
実行使用メモリ 10,008 KB
最終ジャッジ日時 2023-10-21 01:56:24
合計ジャッジ時間 9,212 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,996 KB
testcase_01 AC 30 ms
9,996 KB
testcase_02 AC 35 ms
9,996 KB
testcase_03 AC 38 ms
9,996 KB
testcase_04 AC 1,046 ms
10,008 KB
testcase_05 AC 1,332 ms
10,008 KB
testcase_06 AC 1,329 ms
10,008 KB
testcase_07 AC 148 ms
10,008 KB
testcase_08 AC 763 ms
10,008 KB
testcase_09 AC 1,007 ms
10,008 KB
testcase_10 AC 998 ms
10,008 KB
testcase_11 AC 493 ms
10,008 KB
testcase_12 AC 651 ms
10,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m = map(int, input().split())
    p = 1000000007
    a = pow(n, m, p)
    b = pow(n, m//2, p)
    print(((1+a)*a%p*500000004%p-b*(b+1)%p*(2*b+1)%p*166666668%p)%p)
0