結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー |
![]() |
提出日時 | 2016-04-14 16:23:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 57 ms / 5,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 597 ms |
コンパイル使用メモリ | 59,608 KB |
実行使用メモリ | 42,364 KB |
最終ジャッジ日時 | 2024-10-04 08:42:24 |
合計ジャッジ時間 | 1,253 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;#define RREP(i,s,e) for (i = s; i >= e; i--)#define rrep(i,n) RREP(i,n,0)#define REP(i,s,e) for (i = s; i < e; i++)#define rep(i,n) REP(i,0,n)#define INF 100000000#define MOD 1000000009typedef long long ll;int dp[10][1000000];int main() {int i, j, t;cin >> t;fill(dp[0],dp[0]+1000000,1);REP (i,1,10) {rep (j,1000000) {dp[i][j] = dp[i-1][j] + (i <= j ? dp[i][j-i] : 0);dp[i][j] %= MOD;}}rep (i,t) {ll m;cin >> m;cout << dp[9][m/111111] << endl;}return 0;}