結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー btkbtk
提出日時 2015-05-18 10:24:58
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 61,616 KB
実行使用メモリ 4,928 KB
最終ジャッジ日時 2023-09-20 09:45:52
合計ジャッジ時間 955 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
4,888 KB
testcase_01 AC 25 ms
4,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define LL long long
const LL mod=(LL)(1e9)+9;
LL all[100010];
LL sub[100010];
int main(){
	for(int i=0;i<100010;i++)all[i]=1;
	for(int i=1;i<10;i++){
		for(int j=i;j<100010;j++){
			sub[j]=(all[j-i]+sub[j-i])%mod;
		}
		for(int j=0;j<100010;j++){
			all[j]=(all[j]+sub[j])%mod;
			sub[j]=0;
		}
	}
	LL T,M;
	cin>>T;
	while(T--){
		cin>>M;
		cout<<all[M/111111]<<endl;
	}
}
0