結果

問題 No.695 square1001 and Permutation 4
コンテスト
ユーザー anagohirame
提出日時 2018-06-09 00:11:35
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
MLE  
実行時間 -
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 687 ms
コンパイル使用メモリ 20,884 KB
実行使用メモリ 209,064 KB
最終ジャッジ日時 2026-04-03 10:36:48
合計ジャッジ時間 17,258 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 MLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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