結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー kotatsugamekotatsugame
提出日時 2019-11-21 02:55:14
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 305 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 65,572 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-17 00:11:27
合計ジャッジ時間 1,037 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
6,812 KB
testcase_01 AC 35 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long mod=1e9+9;
long dp[1<<17];
main()
{
	dp[0]=1;
	for(int j=1;j<=9;j++)
	{
		for(int i=j;i<1<<17;i++)(dp[i]+=dp[i-j])%=mod;
	}
	for(int i=1;i<1<<17;i++)(dp[i]+=dp[i-1])%=mod;
	int T;
	cin>>T;
	for(;T--;)
	{
		long M;cin>>M;
		M/=111111;
		cout<<dp[M]<<endl;
	}
}
0