結果

問題 No.695 square1001 and Permutation 4
ユーザー YukiDarumaYukiDaruma
提出日時 2018-06-08 23:20:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 555 bytes
コンパイル時間 1,655 ms
コンパイル使用メモリ 163,668 KB
実行使用メモリ 159,868 KB
最終ジャッジ日時 2023-09-30 01:19:13
合計ジャッジ時間 4,845 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 21 ms
11,176 KB
testcase_02 AC 69 ms
42,664 KB
testcase_03 AC 55 ms
42,444 KB
testcase_04 AC 95 ms
42,680 KB
testcase_05 AC 90 ms
42,496 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 AC 40 ms
18,940 KB
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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[ i + x[ j ] ] += P[ i ];
				P[ i + x[ j ] ] %= iMod;
			}
		}
	}

	cout << P[ i ] << endl;

	return 0;
}




0