結果

問題 No.129 お年玉(2)
ユーザー JunOnumaJunOnuma
提出日時 2017-06-19 11:20:47
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 237 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2024-04-10 06:00:32
合計ジャッジ時間 2,089 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,812 KB
testcase_01 AC 12 ms
6,944 KB
testcase_02 AC 11 ms
6,944 KB
testcase_03 AC 11 ms
6,940 KB
testcase_04 AC 11 ms
6,940 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 12 ms
6,940 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 11 ms
6,940 KB
testcase_13 AC 10 ms
6,944 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 12 ms
6,944 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 10 ms
6,944 KB
testcase_30 AC 10 ms
6,940 KB
testcase_31 AC 10 ms
6,940 KB
testcase_32 AC 10 ms
6,944 KB
testcase_33 AC 10 ms
6,940 KB
testcase_34 AC 11 ms
6,940 KB
testcase_35 AC 10 ms
6,940 KB
testcase_36 AC 11 ms
6,944 KB
testcase_37 AC 10 ms
6,944 KB
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 AC 12 ms
6,940 KB
testcase_44 RE -
testcase_45 AC 12 ms
6,944 KB
testcase_46 AC 11 ms
6,944 KB
testcase_47 RE -
testcase_48 AC 12 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def comb(a,b):
    if b > a - b:
        b = a - b
    if b == 0:
        return 1
    elif b == 1:
        return a
    else:
        return comb(a-1,b-1)*a/b

n = int(raw_input())
m = int(raw_input())
print comb(m, n/1000%m) % (10**9)
0