結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー |
![]() |
提出日時 | 2018-12-29 16:31:11 |
言語 | C++11 (gcc 8.5.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 732 bytes |
コンパイル時間 | 678 ms |
実行使用メモリ | 5,084 KB |
最終ジャッジ日時 | 2022-11-25 04:02:13 |
合計ジャッジ時間 | 1,599 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 21 ms
5,032 KB |
testcase_01 | AC | 23 ms
5,084 KB |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> using namespace std; typedef long long int ll; typedef pair<int, int> P; const ll MOD=1e9+9; int main() { ll dp[100000]={}; dp[0]=1; for(int i=1; i<=9; i++){ for(int j=0; j<100000-i; j++){ dp[j+i]+=dp[j]; dp[j+i]%=MOD; } } ll s[100000]; s[0]=1; for(int i=1; i<100000; i++) s[i]=(s[i-1]+dp[i])%MOD; int t; cin>>t; for(int i=0; i<t; i++){ ll m; cin>>m; cout<<s[m/111111]<<endl; } return 0; }