結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー |
![]() |
提出日時 | 2019-08-09 00:00:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 456 bytes |
コンパイル時間 | 592 ms |
コンパイル使用メモリ | 71,040 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 21:14:28 |
合計ジャッジ時間 | 973 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 |
ソースコード
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MOD = (int)1e9 + 9; int main() { const int ZORO = 111111; const int MAX = 1e10 / ZORO; vector<int> dp(MAX + 1, 1); for (int i = 1; i <= 9; i++) { for (int j = i; j <= MAX; j++) (dp[j] += dp[j - i]) %= MOD; } int T; cin >> T; while (T--) { long long M; cin >> M; cout << dp[M / ZORO] << endl; } return 0; }