結果

問題 No.3046 yukicoderの過去問
ユーザー mlihua09mlihua09
提出日時 2020-08-23 16:27:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 433 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 45,728 KB
最終ジャッジ日時 2024-04-23 18:04:56
合計ジャッジ時間 4,165 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
16,128 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 216 ms
34,976 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 102 ms
34,852 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #


K = int(input())

N = int(input())

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

import sys

sys.setrecursionlimit(10 ** 9)

P = 10 ** 9 + 7

note = [1] + [-1] * K

import bisect

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