結果

問題 No.129 お年玉(2)
ユーザー Coki628Coki628
提出日時 2020-10-20 02:42:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 1,025 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 87,424 KB
実行使用メモリ 76,244 KB
最終ジャッジ日時 2023-09-28 13:33:58
合計ジャッジ時間 5,997 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,836 KB
testcase_01 AC 81 ms
75,488 KB
testcase_02 AC 72 ms
71,632 KB
testcase_03 AC 73 ms
71,828 KB
testcase_04 AC 74 ms
71,420 KB
testcase_05 AC 78 ms
75,768 KB
testcase_06 AC 80 ms
76,032 KB
testcase_07 AC 79 ms
75,756 KB
testcase_08 AC 80 ms
76,000 KB
testcase_09 AC 80 ms
75,692 KB
testcase_10 AC 81 ms
75,588 KB
testcase_11 AC 80 ms
75,896 KB
testcase_12 AC 82 ms
75,764 KB
testcase_13 AC 81 ms
75,808 KB
testcase_14 AC 80 ms
76,244 KB
testcase_15 AC 80 ms
75,792 KB
testcase_16 AC 81 ms
75,832 KB
testcase_17 AC 80 ms
75,752 KB
testcase_18 AC 79 ms
75,680 KB
testcase_19 AC 80 ms
75,952 KB
testcase_20 AC 81 ms
75,940 KB
testcase_21 AC 83 ms
75,512 KB
testcase_22 AC 80 ms
75,940 KB
testcase_23 AC 79 ms
75,764 KB
testcase_24 AC 80 ms
75,888 KB
testcase_25 AC 78 ms
75,836 KB
testcase_26 AC 80 ms
75,792 KB
testcase_27 AC 78 ms
75,884 KB
testcase_28 AC 80 ms
75,672 KB
testcase_29 AC 73 ms
71,852 KB
testcase_30 AC 70 ms
72,040 KB
testcase_31 AC 71 ms
71,804 KB
testcase_32 AC 71 ms
71,824 KB
testcase_33 AC 71 ms
71,960 KB
testcase_34 AC 73 ms
71,700 KB
testcase_35 AC 73 ms
71,716 KB
testcase_36 AC 72 ms
71,560 KB
testcase_37 AC 72 ms
71,588 KB
testcase_38 AC 78 ms
76,024 KB
testcase_39 AC 76 ms
75,788 KB
testcase_40 AC 79 ms
75,952 KB
testcase_41 AC 77 ms
75,748 KB
testcase_42 AC 77 ms
76,020 KB
testcase_43 AC 77 ms
75,840 KB
testcase_44 AC 81 ms
75,968 KB
testcase_45 AC 77 ms
75,812 KB
testcase_46 AC 76 ms
75,868 KB
testcase_47 AC 84 ms
76,092 KB
testcase_48 AC 81 ms
75,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

def nCr(n, r):
    """ 事前テーブルなし組み合わせ簡易版 """
    from math import factorial

    if n < r: return 0
    # 10C7 = 10C3
    r = min(r, n-r)
    return factorial(n) // (factorial(r) * factorial(n-r))

N = INT()
M = INT()
MOD = 10**9

N //= 1000
rest = N % M

ans = nCr(M, rest) % MOD
print(ans)
0