結果

問題 No.1518 Simple Combinatorics
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-07 22:24:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 116 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 53,428 KB
最終ジャッジ日時 2024-05-03 23:06:11
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,264 KB
testcase_01 AC 37 ms
52,068 KB
testcase_02 AC 37 ms
53,132 KB
testcase_03 AC 34 ms
51,872 KB
testcase_04 AC 36 ms
52,552 KB
testcase_05 AC 35 ms
52,216 KB
testcase_06 AC 38 ms
53,232 KB
testcase_07 AC 37 ms
52,608 KB
testcase_08 AC 39 ms
52,392 KB
testcase_09 AC 35 ms
52,608 KB
testcase_10 AC 34 ms
52,312 KB
testcase_11 AC 37 ms
51,940 KB
testcase_12 AC 34 ms
52,700 KB
testcase_13 AC 35 ms
53,428 KB
testcase_14 AC 38 ms
52,260 KB
testcase_15 AC 38 ms
51,824 KB
testcase_16 AC 36 ms
51,824 KB
testcase_17 AC 37 ms
51,960 KB
testcase_18 AC 34 ms
52,672 KB
testcase_19 AC 33 ms
51,960 KB
testcase_20 AC 35 ms
51,628 KB
testcase_21 AC 32 ms
52,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
mod = 10**9+7
ans = pow(n, k, mod)-pow(n-1, k, mod)
ans *= n
ans %= mod
print(ans)
0