結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
75,648 KB
testcase_01 AC 82 ms
75,648 KB
testcase_02 AC 83 ms
75,264 KB
testcase_03 AC 81 ms
75,520 KB
testcase_04 AC 83 ms
75,392 KB
testcase_05 AC 87 ms
75,648 KB
testcase_06 AC 83 ms
75,264 KB
testcase_07 AC 82 ms
75,264 KB
testcase_08 AC 82 ms
75,264 KB
testcase_09 AC 206 ms
97,920 KB
testcase_10 AC 196 ms
98,176 KB
testcase_11 AC 170 ms
98,304 KB
testcase_12 AC 83 ms
75,648 KB
testcase_13 AC 205 ms
98,048 KB
testcase_14 AC 184 ms
93,312 KB
testcase_15 AC 201 ms
95,360 KB
testcase_16 AC 155 ms
86,016 KB
testcase_17 AC 168 ms
89,088 KB
testcase_18 AC 146 ms
83,968 KB
testcase_19 AC 144 ms
83,968 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