結果
| 問題 | No.695 square1001 and Permutation 4 |
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2018-05-11 21:54:05 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 661 ms |
| コンパイル使用メモリ | 63,488 KB |
| 実行使用メモリ | 159,744 KB |
| 最終ジャッジ日時 | 2024-07-22 19:13:10 |
| 合計ジャッジ時間 | 3,282 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 MLE * 7 |
ソースコード
#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;
}
square1001