結果
| 問題 | No.41 貯金箱の溜息(EASY) |
| コンテスト | |
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2018-01-10 22:15:26 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1,752 ms / 5,000 ms |
| コード長 | 976 bytes |
| 記録 | |
| コンパイル時間 | 436 ms |
| コンパイル使用メモリ | 89,432 KB |
| 実行使用メモリ | 9,856 KB |
| 最終ジャッジ日時 | 2026-05-29 16:38:44 |
| 合計ジャッジ時間 | 2,971 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define FOR(i, s, e) for (int i = (s); i <= (e); i++)
#define MOD(N) ((N) % 1000000009)
ll T;
ll M;
ll dp[10][90010];
int main()
{
FOR(i, 0, 9)
{
FOR(j, 0, 9009)
{
dp[i][j] = 0;
}
}
dp[0][0] = 1;
FOR(i, 1, 9)
{
FOR(j, 0, 90009)
{
if (j - i >= 0)
{
dp[i][j] += dp[i - 1][j] + dp[i][j - i];
}
else
{
dp[i][j] += dp[i - 1][j];
}
dp[i][j] = MOD(dp[i][j]);
}
}
cin >> T;
FOR(c, 0, T - 1)
{
cin >> M;
int N = M / 111111;
ll result = 0;
FOR(i, 0, N)
{
result = MOD(result + dp[9][i]);
}
cout << result << endl;
}
}
Kutimoti_T