結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-16 00:37:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 5,000 ms |
| コード長 | 459 bytes |
| コンパイル時間 | 336 ms |
| コンパイル使用メモリ | 54,996 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 21:33:33 |
| 合計ジャッジ時間 | 896 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
#include <iostream>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 9;
const int MAX = 100000;
int coin[] = {1, 1, 2, 3, 4, 5, 6, 7, 8, 9};
ll dp[MAX];
int main(){
dp[0] = 1;
for(int i=0;i<10;i++){
for(int sum=0;sum+coin[i]<MAX;sum++){
dp[sum+coin[i]] += dp[sum];
dp[sum+coin[i]] %= MOD;
}
}
int T;
cin >> T;
while(T--){
ll M;
cin >> M;
cout << dp[M / 111111] << endl;
}
return 0;
}