結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー btkbtk
提出日時 2015-05-18 10:28:09
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 52,240 KB
実行使用メモリ 5,088 KB
最終ジャッジ日時 2023-09-20 09:45:53
合計ジャッジ時間 851 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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