結果

問題 No.695 square1001 and Permutation 4
ユーザー anagohirameanagohirame
提出日時 2018-06-09 00:11:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 294 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 193,800 KB
最終ジャッジ日時 2023-09-30 01:24:41
合計ジャッジ時間 17,567 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,732 KB
testcase_01 AC 2,280 ms
55,764 KB
testcase_02 AC 2,353 ms
47,304 KB
testcase_03 AC 2,390 ms
47,256 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

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