結果

問題 No.1518 Simple Combinatorics
ユーザー vwxyz
提出日時 2023-04-03 07:37:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 134 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-25 00:43:29
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

N,K=map(int,readline().split())
mod=10**9+7
ans=(pow(N,K,mod)-pow(N-1,K,mod))*N%mod
print(ans)
0