結果
| 問題 | No.41 貯金箱の溜息(EASY) |
| コンテスト | |
| ユーザー |
Kutimoti_T
|
| 提出日時 | 2018-01-10 22:13:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,054 bytes |
| 記録 | |
| コンパイル時間 | 608 ms |
| コンパイル使用メモリ | 66,856 KB |
| 実行使用メモリ | 17,336 KB |
| 最終ジャッジ日時 | 2024-12-23 17:07:09 |
| 合計ジャッジ時間 | 7,725 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
ソースコード
#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()
{
cin >> T;
FOR(c,0,T - 1)
{
cin >> M;
int N = M / 111111;
FOR(i,0,9)
{
FOR(j,0,9009)
{
dp[i][j] = 0;
}
}
dp[0][0] = 1;
FOR(i,1,9)
{
FOR(j,0,N)
{
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]);
}
}
ll result = 0;
FOR(i,0,N)
{
result = MOD(result + dp[9][i]);
}
cout << result << endl;
}
}
Kutimoti_T