結果

問題 No.2188 整数列コイントスゲーム
ユーザー TKTYITKTYI
提出日時 2023-09-10 08:26:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 301 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 79,204 KB
最終ジャッジ日時 2023-09-10 08:26:16
合計ジャッジ時間 11,797 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,188 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 70 ms
70,744 KB
testcase_06 AC 71 ms
71,264 KB
testcase_07 AC 71 ms
71,160 KB
testcase_08 AC 70 ms
71,204 KB
testcase_09 AC 73 ms
71,012 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 70 ms
71,076 KB
testcase_16 AC 71 ms
71,048 KB
testcase_17 AC 70 ms
71,224 KB
testcase_18 AC 71 ms
71,200 KB
testcase_19 AC 69 ms
71,124 KB
testcase_20 AC 72 ms
71,236 KB
testcase_21 WA -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 72 ms
71,116 KB
testcase_26 AC 73 ms
70,920 KB
testcase_27 WA -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 71 ms
71,132 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 72 ms
71,232 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 AC 71 ms
71,080 KB
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 AC 72 ms
71,084 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