結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-21 02:55:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 5,000 ms |
| コード長 | 305 bytes |
| コンパイル時間 | 569 ms |
| コンパイル使用メモリ | 64,220 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-08 07:37:35 |
| 合計ジャッジ時間 | 1,245 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
long mod=1e9+9;
long dp[1<<17];
main()
{
dp[0]=1;
for(int j=1;j<=9;j++)
{
for(int i=j;i<1<<17;i++)(dp[i]+=dp[i-j])%=mod;
}
for(int i=1;i<1<<17;i++)(dp[i]+=dp[i-1])%=mod;
int T;
cin>>T;
for(;T--;)
{
long M;cin>>M;
M/=111111;
cout<<dp[M]<<endl;
}
}