結果

問題 No.391 CODING WAR
ユーザー cielciel
提出日時 2016-07-09 22:32:46
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 1,429 ms
コンパイル使用メモリ 76,416 KB
実行使用メモリ 98,560 KB
最終ジャッジ日時 2024-04-21 10:57:41
合計ジャッジ時間 3,732 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
75,520 KB
testcase_01 AC 84 ms
75,648 KB
testcase_02 AC 78 ms
75,520 KB
testcase_03 AC 76 ms
75,520 KB
testcase_04 AC 76 ms
75,648 KB
testcase_05 AC 78 ms
75,264 KB
testcase_06 AC 77 ms
75,776 KB
testcase_07 AC 77 ms
75,136 KB
testcase_08 AC 78 ms
75,520 KB
testcase_09 AC 204 ms
98,304 KB
testcase_10 AC 189 ms
98,560 KB
testcase_11 AC 160 ms
98,048 KB
testcase_12 AC 78 ms
75,392 KB
testcase_13 AC 196 ms
98,176 KB
testcase_14 AC 178 ms
93,312 KB
testcase_15 AC 188 ms
95,360 KB
testcase_16 AC 145 ms
86,528 KB
testcase_17 AC 153 ms
89,344 KB
testcase_18 AC 133 ms
83,712 KB
testcase_19 AC 134 ms
83,840 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