結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-05-18 10:24:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 5,000 ms |
| コード長 | 451 bytes |
| コンパイル時間 | 506 ms |
| コンパイル使用メモリ | 60,240 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 05:21:04 |
| 合計ジャッジ時間 | 1,054 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
#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;
}
}
btk