結果
問題 |
No.1518 Simple Combinatorics
|
ユーザー |
![]() |
提出日時 | 2021-05-29 13:26:55 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 147 bytes |
コンパイル時間 | 390 ms |
コンパイル使用メモリ | 81,992 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-11-07 21:27:50 |
合計ジャッジ時間 | 2,227 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
import sys input = sys.stdin.readline N, K = map(int, input().split()) mod = 10 ** 9 + 7 print((pow(N, K + 1, mod) - N * pow(N - 1, K, mod)) % mod)