結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 23 ms
11,172 KB
testcase_02 AC 73 ms
42,452 KB
testcase_03 AC 53 ms
42,404 KB
testcase_04 AC 104 ms
42,472 KB
testcase_05 AC 102 ms
42,492 KB
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 AC 43 ms
18,996 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++ )
	{
		if( P[ i ] == 0 ) continue;

		for( j = 0; j < m; j++ )
		{
			k = i + x[ j ];
			if( k <= n )
			{
				P[ k ] += P[ i ];
				P[ k ] %= iMod;
			}
		}
	}

	cout << P[ n ] << endl;

	return 0;
}




0