結果
| 問題 |
No.695 square1001 and Permutation 4
|
| ユーザー |
|
| 提出日時 | 2018-06-08 23:22:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 536 bytes |
| コンパイル時間 | 1,725 ms |
| コンパイル使用メモリ | 165,444 KB |
| 実行使用メモリ | 159,744 KB |
| 最終ジャッジ日時 | 2024-07-22 19:15:52 |
| 合計ジャッジ時間 | 4,344 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 MLE * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
//vector<long long> P( 20000000 );
long long P[ 20000000 ];
const long long iMod = 100000000000000007;
int main()
{
int i;
int j;
int k;
int n;
int m;
int x[ 10 ];
ios::sync_with_stdio( false );
cin.tie( 0 );
cin >> n;
cin >> m;
for( i = 0; i < m; i++ ) cin >> x[ i ];
P[ 1 ] = 1;
for( i = 1; i < n; i++ )
{
for( j = 0; j < m; j++ )
{
k = i + x[ j ];
if( k <= n )
{
P[ k ] += P[ i ];
P[ k ] %= iMod;
}
}
}
cout << P[ i ] << endl;
return 0;
}