結果

問題 No.1581 Multiple Sequence
ユーザー pengin_2000pengin_2000
提出日時 2021-07-03 09:52:18
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 28,572 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 14:44:43
合計ジャッジ時間 3,924 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 173 ms
4,376 KB
testcase_03 AC 193 ms
4,376 KB
testcase_04 AC 41 ms
4,380 KB
testcase_05 AC 205 ms
4,376 KB
testcase_06 AC 77 ms
4,380 KB
testcase_07 AC 38 ms
4,376 KB
testcase_08 AC 56 ms
4,376 KB
testcase_09 AC 181 ms
4,380 KB
testcase_10 AC 109 ms
4,380 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 62 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 196 ms
4,376 KB
testcase_15 AC 131 ms
4,376 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 221 ms
4,380 KB
testcase_18 AC 13 ms
4,380 KB
testcase_19 AC 165 ms
4,380 KB
testcase_20 AC 174 ms
4,380 KB
testcase_21 AC 193 ms
4,376 KB
testcase_22 AC 96 ms
4,376 KB
testcase_23 AC 228 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	long long int m;
	scanf("%lld", &m);
	long long int p = 1000000007;
	long long int dp[100005];
	long long int i, j;
	dp[0] = 1;
	for (i = 1; i <= m; i++)
	{
		dp[i] = 0;
		for (j = 1; j * j <= i; j++)
		{
			if (i % j == 0)
			{
				dp[i] = (dp[i] + dp[i / j - 1]) % p;
				if (j * j < i)
					dp[i] = (dp[i] + dp[j - 1]) % p;
			}
		}
	}
	printf("%lld\n", dp[m]);
	return 0;
}
0