結果
問題 | No.1518 Simple Combinatorics |
ユーザー |
|
提出日時 | 2021-05-28 21:01:23 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 62,248 KB |
最終ジャッジ日時 | 2024-11-07 08:32:36 |
合計ジャッジ時間 | 2,169 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
# import sys# input = sys.stdin.readlinedef mp():return map(int,input().split())def lmp():return list(map(int,input().split()))import mathimport bisectfrom copy import deepcopy as dcfrom itertools import accumulatefrom collections import Counter, defaultdict, dequedef ceil(U,V):return (U+V-1)//Vdef modf1(N,MOD):return (N-1)%MOD+1inf = int(1e30)mod = int(1e9+7)n,k = mp()print((pow(n,k,mod) - pow(n-1,k,mod))*n%mod)