結果

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

テストケース

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

ソースコード

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