結果
| 問題 | No.129 お年玉(2) | 
| コンテスト | |
| ユーザー |  mkawa2 | 
| 提出日時 | 2019-12-24 13:25:07 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 789 bytes | 
| コンパイル時間 | 319 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 16,128 KB | 
| 最終ジャッジ日時 | 2024-09-21 21:28:00 | 
| 合計ジャッジ時間 | 12,888 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | TLE * 1 -- * 45 | 
ソースコード
from collections import *
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
md = 10 ** 9
def com(com_n, com_r):
    if com_n < com_r * 2: com_r = com_n - com_r
    if com_r==1:return com_n
    if com_r==0:return 1
    return (com(com_n - 1, com_r) + com(com_n - 1, com_r - 1)) % md
def main():
    n = II()
    m = II()
    n //= 1000
    hit = n % m
    print(com(m, hit))
main()
            
            
            
        