結果

問題 No.695 square1001 and Permutation 4
ユーザー simamumusimamumu
提出日時 2018-06-29 20:23:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 299 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 153,528 KB
最終ジャッジ日時 2023-09-30 01:38:06
合計ジャッジ時間 19,350 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
14,940 KB
testcase_01 AC 2,993 ms
55,164 KB
testcase_02 AC 3,728 ms
47,364 KB
testcase_03 AC 3,595 ms
47,344 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())

x = list(map(int,input().split()))

x.sort()

dp = [0 for i in range(n)]

p = 100000000000000007 

for i in range(m):
	dp[x[i]] += 1
	
for i in range(n):
	for j in range(m):
		if i - x[j] >= 0:
			dp[i] += dp[i-x[j]]
			if dp[i] > p:
				dp[i] %= p
			
print(dp[n-1])
0