結果
| 問題 |
No.8046 yukicoderの過去問
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-23 16:33:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 468 bytes |
| コンパイル時間 | 102 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 73,680 KB |
| 最終ジャッジ日時 | 2024-10-15 18:45:11 |
| 合計ジャッジ時間 | 10,962 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 5 TLE * 1 -- * 2 |
ソースコード
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))