結果

問題 No.695 square1001 and Permutation 4
ユーザー anagohirame
提出日時 2018-06-09 00:15:42
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 294 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 232,276 KB
最終ジャッジ日時 2024-07-22 19:21:28
合計ジャッジ時間 11,127 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 MLE * 1
other MLE * 12
権限があれば一括ダウンロードができます

ソースコード

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