結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー btk
提出日時 2015-05-18 10:30:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 334 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 54,392 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 05:21:17
合計ジャッジ時間 744 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
#define LL long long
#define N 111111
LL mod=(1e9)+9,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