結果

問題 No.129 お年玉(2)
ユーザー Coki628Coki628
提出日時 2020-10-20 02:35:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,929 ms / 5,000 ms
コード長 1,087 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,460 KB
実行使用メモリ 92,800 KB
最終ジャッジ日時 2023-09-28 13:33:51
合計ジャッジ時間 36,143 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
77,488 KB
testcase_01 AC 1,929 ms
88,108 KB
testcase_02 AC 75 ms
71,700 KB
testcase_03 AC 73 ms
71,576 KB
testcase_04 AC 74 ms
71,808 KB
testcase_05 AC 805 ms
80,900 KB
testcase_06 AC 846 ms
78,888 KB
testcase_07 AC 1,315 ms
81,936 KB
testcase_08 AC 1,064 ms
82,708 KB
testcase_09 AC 800 ms
78,116 KB
testcase_10 AC 1,430 ms
83,928 KB
testcase_11 AC 825 ms
78,936 KB
testcase_12 AC 200 ms
77,512 KB
testcase_13 AC 165 ms
77,548 KB
testcase_14 AC 872 ms
79,160 KB
testcase_15 AC 745 ms
78,252 KB
testcase_16 AC 958 ms
79,900 KB
testcase_17 AC 723 ms
78,256 KB
testcase_18 AC 1,270 ms
80,536 KB
testcase_19 AC 1,487 ms
85,996 KB
testcase_20 AC 1,173 ms
80,672 KB
testcase_21 AC 883 ms
78,516 KB
testcase_22 AC 925 ms
79,960 KB
testcase_23 AC 1,443 ms
82,564 KB
testcase_24 AC 1,573 ms
87,796 KB
testcase_25 AC 803 ms
78,976 KB
testcase_26 AC 985 ms
81,608 KB
testcase_27 AC 934 ms
79,592 KB
testcase_28 AC 1,286 ms
79,636 KB
testcase_29 AC 74 ms
71,680 KB
testcase_30 AC 72 ms
71,688 KB
testcase_31 AC 72 ms
71,420 KB
testcase_32 AC 74 ms
71,696 KB
testcase_33 AC 76 ms
72,004 KB
testcase_34 AC 84 ms
76,536 KB
testcase_35 AC 83 ms
76,884 KB
testcase_36 AC 90 ms
76,868 KB
testcase_37 AC 88 ms
77,204 KB
testcase_38 AC 212 ms
77,500 KB
testcase_39 AC 228 ms
77,428 KB
testcase_40 AC 494 ms
77,868 KB
testcase_41 AC 522 ms
78,596 KB
testcase_42 AC 275 ms
77,588 KB
testcase_43 AC 138 ms
77,632 KB
testcase_44 AC 1,854 ms
92,800 KB
testcase_45 AC 186 ms
77,616 KB
testcase_46 AC 151 ms
77,188 KB
testcase_47 AC 1,701 ms
87,600 KB
testcase_48 AC 1,104 ms
82,592 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

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

N //= 1000
rest = N % M

fr = [0] * (rest+1)
to = [0] * (rest+1)
fr[0] = 1
for i in range(M):
    for j in range(rest+1):
        if fr[j] == 0:
            break
        to[j] += fr[j]
        to[j] %= MOD
        if j+1 <= rest:
            to[j+1] += fr[j]
            to[j+1] %= MOD
    fr = to[:]
    to = [0] * (rest+1)
ans = fr[rest]
print(ans)
0