結果

問題 No.391 CODING WAR
ユーザー cielciel
提出日時 2016-07-09 22:32:18
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 77,184 KB
実行使用メモリ 98,108 KB
最終ジャッジ日時 2024-04-21 10:57:36
合計ジャッジ時間 4,285 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
75,196 KB
testcase_01 AC 86 ms
75,028 KB
testcase_02 AC 88 ms
75,512 KB
testcase_03 AC 87 ms
75,572 KB
testcase_04 AC 87 ms
75,420 KB
testcase_05 AC 87 ms
75,448 KB
testcase_06 AC 88 ms
75,436 KB
testcase_07 AC 92 ms
75,008 KB
testcase_08 AC 88 ms
75,428 KB
testcase_09 AC 226 ms
98,048 KB
testcase_10 AC 203 ms
98,092 KB
testcase_11 AC 181 ms
98,068 KB
testcase_12 AC 88 ms
75,164 KB
testcase_13 AC 214 ms
98,108 KB
testcase_14 AC 199 ms
92,820 KB
testcase_15 AC 212 ms
95,488 KB
testcase_16 AC 166 ms
86,656 KB
testcase_17 AC 175 ms
89,536 KB
testcase_18 AC 152 ms
83,472 KB
testcase_19 AC 156 ms
83,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,raw_input().split())
M=10**9+7
I=[1,1];F=[1,1];R=[1,1]
for i in range(2,m+1):
	I+=[(M-M//i)*I[M%i]%M]
	F+=[i*F[i-1]%M]
	R+=[I[i]*R[i-1]%M]
print(sum((-1)**k*F[m]*R[k]*R[m-k]*pow(m-k,n,M)for k in range(m))%M)
0