結果

問題 No.3046 yukicoderの過去問
ユーザー mlihua09mlihua09
提出日時 2020-08-23 16:33:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 112,780 KB
最終ジャッジ日時 2024-04-23 18:05:42
合計ジャッジ時間 9,637 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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