結果

問題 No.3046 yukicoderの過去問
ユーザー mlihua09mlihua09
提出日時 2020-08-23 16:32:41
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 468 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 66,940 KB
最終ジャッジ日時 2024-04-23 18:05:27
合計ジャッジ時間 1,224 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

import numpy as np

sys.setrecursionlimit(10 ** 9)

K = int(input())

N = int(input())

X = np.array(list(map(int, input().split())))


P = 10 ** 9 + 7

note = np.full(K + 1, -1)

note[0] = 0


def main(x):
    
    if note[x] != -1:
        
        return note[x]
        
    note[x] = 0
    
    for i in range(np.searchsorted(X, x)):
        
        note[x] += main(x - X[i])
        
        note[x] %= P
    
    return note[x]
    
print(main(K))
0