結果

問題 No.129 お年玉(2)
ユーザー daleksprinterdaleksprinter
提出日時 2018-08-27 00:48:25
言語 Python2
(2.7.18)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 6,540 KB
最終ジャッジ日時 2023-08-18 18:09:43
合計ジャッジ時間 4,159 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
6,072 KB
testcase_01 AC 75 ms
6,540 KB
testcase_02 AC 11 ms
6,052 KB
testcase_03 AC 12 ms
6,056 KB
testcase_04 AC 11 ms
5,980 KB
testcase_05 AC 35 ms
6,436 KB
testcase_06 AC 44 ms
6,368 KB
testcase_07 AC 55 ms
6,336 KB
testcase_08 AC 44 ms
6,400 KB
testcase_09 AC 51 ms
6,324 KB
testcase_10 AC 57 ms
6,440 KB
testcase_11 AC 38 ms
6,408 KB
testcase_12 AC 53 ms
6,468 KB
testcase_13 AC 55 ms
6,320 KB
testcase_14 AC 48 ms
6,304 KB
testcase_15 AC 42 ms
6,272 KB
testcase_16 AC 46 ms
6,372 KB
testcase_17 AC 55 ms
6,480 KB
testcase_18 AC 53 ms
6,388 KB
testcase_19 AC 58 ms
6,336 KB
testcase_20 AC 53 ms
6,324 KB
testcase_21 AC 67 ms
6,460 KB
testcase_22 AC 41 ms
6,348 KB
testcase_23 AC 59 ms
6,348 KB
testcase_24 AC 62 ms
6,356 KB
testcase_25 AC 39 ms
6,372 KB
testcase_26 AC 41 ms
6,392 KB
testcase_27 AC 40 ms
6,264 KB
testcase_28 AC 65 ms
6,372 KB
testcase_29 AC 11 ms
6,148 KB
testcase_30 AC 10 ms
6,152 KB
testcase_31 AC 11 ms
5,988 KB
testcase_32 AC 10 ms
6,092 KB
testcase_33 AC 11 ms
6,028 KB
testcase_34 AC 11 ms
6,000 KB
testcase_35 AC 11 ms
6,004 KB
testcase_36 AC 11 ms
6,020 KB
testcase_37 AC 11 ms
6,020 KB
testcase_38 AC 17 ms
6,244 KB
testcase_39 AC 20 ms
6,224 KB
testcase_40 AC 38 ms
6,364 KB
testcase_41 AC 27 ms
6,324 KB
testcase_42 AC 18 ms
6,244 KB
testcase_43 AC 17 ms
6,272 KB
testcase_44 AC 72 ms
6,388 KB
testcase_45 AC 15 ms
6,188 KB
testcase_46 AC 23 ms
6,176 KB
testcase_47 AC 67 ms
6,380 KB
testcase_48 AC 45 ms
6,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorial(x):
	retval = 1
	for i in range(2,x+1):
		retval = retval * i
	return retval

def nCr(n,r):
	return factorial(n)/ factorial(n-r)/factorial(r) %10**9

n = int(input())

m = int(input())

rest = (n%(1000*m))
print nCr(m,(rest - (rest%1000))/1000)
0