結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー |
![]() |
提出日時 | 2019-08-09 00:00:30 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 19 ms / 5,000 ms |
コード長 | 456 bytes |
コンパイル時間 | 530 ms |
使用メモリ | 9,692 KB |
最終ジャッジ日時 | 2023-02-16 21:55:05 |
合計ジャッジ時間 | 1,562 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 19 ms
9,628 KB |
testcase_01 | AC | 19 ms
9,692 KB |
ソースコード
#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; }