結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー chocoruskchocorusk
提出日時 2018-12-29 16:31:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 732 bytes
コンパイル時間 766 ms
コンパイル使用メモリ 96,268 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-09 03:23:06
合計ジャッジ時間 1,417 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
6,820 KB
testcase_01 AC 24 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=1e9+9;
int main()
{
	ll dp[100000]={};
	dp[0]=1;
	for(int i=1; i<=9; i++){
		for(int j=0; j<100000-i; j++){
			dp[j+i]+=dp[j];
			dp[j+i]%=MOD;
		}
	}
	ll s[100000]; s[0]=1;
	for(int i=1; i<100000; i++) s[i]=(s[i-1]+dp[i])%MOD;
	int t; cin>>t;
	for(int i=0; i<t; i++){
		ll m; cin>>m;
		cout<<s[m/111111]<<endl;
	}
	return 0;
}
0