結果

問題 No.695 square1001 and Permutation 4
ユーザー square1001square1001
提出日時 2018-05-11 21:54:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 376 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 64,648 KB
実行使用メモリ 159,888 KB
最終ジャッジ日時 2023-09-30 01:16:39
合計ジャッジ時間 3,537 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 17 ms
11,152 KB
testcase_02 AC 67 ms
42,596 KB
testcase_03 AC 58 ms
42,416 KB
testcase_04 AC 76 ms
42,404 KB
testcase_05 AC 77 ms
42,520 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 AC 32 ms
18,904 KB
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
const long long mod = 100000000000000007;
int n, m, x[7]; long long dp[100000009];
int main() {
	cin >> n >> m; n--;
	for (int i = 0; i < m; i++) cin >> x[i];
	dp[0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < m; j++) {
			if (i >= x[j]) dp[i] += dp[i - x[j]];
		}
		dp[i] %= mod;
	}
	cout << dp[n] << '\n';
	return 0;
}
0