結果

問題 No.695 square1001 and Permutation 4
ユーザー anagohirame
提出日時 2018-06-09 00:11:35
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
MLE  
実行時間 -
コード長 294 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 195,976 KB
最終ジャッジ日時 2024-07-22 19:21:09
合計ジャッジ時間 16,396 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 MLE * 1
other AC * 2 TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = (10 ** 17) + 7
n, m = map(int, input().split())
x = list(map(int, input().split()))

cost = [0 for _ in range(n)]
cost[0] = 1

def areba(i, j):
	if i < j:
		return 0
	else:
		return cost[i - j]

for i in range(1, n):
	for j in x:
		cost[i] = (cost[i] + areba(i, j)) % MOD

print(cost[-1])
0