結果

問題 No.2188 整数列コイントスゲーム
ユーザー TKTYITKTYI
提出日時 2023-09-10 08:23:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 71,676 KB
最終ジャッジ日時 2023-09-10 08:23:22
合計ジャッジ時間 10,938 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,248 KB
testcase_01 AC 69 ms
71,036 KB
testcase_02 AC 71 ms
71,472 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 69 ms
71,460 KB
testcase_06 AC 69 ms
71,072 KB
testcase_07 AC 70 ms
71,072 KB
testcase_08 AC 68 ms
71,444 KB
testcase_09 AC 69 ms
71,308 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 71 ms
71,536 KB
testcase_16 AC 70 ms
71,340 KB
testcase_17 AC 71 ms
71,296 KB
testcase_18 AC 71 ms
71,588 KB
testcase_19 AC 70 ms
71,384 KB
testcase_20 AC 70 ms
71,188 KB
testcase_21 AC 71 ms
71,032 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 72 ms
71,268 KB
testcase_26 AC 70 ms
71,244 KB
testcase_27 AC 72 ms
71,532 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 69 ms
71,192 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 69 ms
71,396 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 70 ms
71,660 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 72 ms
71,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def BI(n,r):
	res=1
	for i in range(r):
		res*=n-i
		res/=i+1
	return res
	
N=int(input())
M=int(input())
if M>N :
	print("0\n")
elif N==0 :
	print("1\n")
else :
	T=[0]*(M+1)
	for i in range(1,M+1):
		T[i]=1
		for j in range(M):
			T[i]*=j+1
		for j in range(i):
			T[i]-=T[j]*BI(i,j)
	print(T[M])
0