結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー | hogeover30 |
提出日時 | 2015-03-03 20:02:12 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 10 ms / 5,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 26,284 KB |
実行使用メモリ | 10,008 KB |
最終ジャッジ日時 | 2023-09-06 06:36:14 |
合計ジャッジ時間 | 817 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 9 ms
9,948 KB |
testcase_01 | AC | 10 ms
10,008 KB |
ソースコード
#include <cstdio> typedef long long ll; const int mod=1e9+9; ll dp[10][100010]; #define max(x, y) (x>y?x:y) int main() { dp[0][0]=1; for(int i=1;i<10;++i) { for(int j=0;j<100010;++j) { dp[i][j]=((j>=i?dp[i][j-i]:0)+max(1,dp[i-1][j]))%mod; } } int T; scanf("%d", &T); while (T--) { ll M; scanf("%lld", &M); M/=111111; printf("%lld\n", dp[M>9?9:M][M]); } }