結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,084 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 73 ms
71,104 KB
testcase_06 AC 71 ms
71,204 KB
testcase_07 AC 73 ms
71,084 KB
testcase_08 AC 71 ms
71,024 KB
testcase_09 AC 69 ms
71,160 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 70 ms
71,080 KB
testcase_16 AC 72 ms
71,228 KB
testcase_17 AC 70 ms
70,744 KB
testcase_18 AC 72 ms
71,232 KB
testcase_19 AC 71 ms
71,264 KB
testcase_20 AC 71 ms
71,080 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 70 ms
71,232 KB
testcase_25 AC 71 ms
71,120 KB
testcase_26 AC 71 ms
71,224 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 74 ms
71,224 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 71 ms
71,232 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 69 ms
71,136 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 72 ms
71,104 KB
testcase_46 AC 71 ms
71,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def BI(n,r):
	res=1
	for i in range(r):
		res*=n-i
		res=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(N):
			T[i]*=j+1
		for j in range(i):
			T[i]-=T[j]*BI(i,j)
	print(T[M])
0