結果

問題 No.741 AscNumber(Easy)
ユーザー syunsukesyunsuke
提出日時 2019-09-11 16:18:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 227 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 51,816 KB
実行使用メモリ 89,616 KB
最終ジャッジ日時 2023-09-15 13:49:38
合計ジャッジ時間 6,302 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
89,448 KB
testcase_01 AC 29 ms
89,616 KB
testcase_02 AC 29 ms
89,420 KB
testcase_03 AC 28 ms
89,248 KB
testcase_04 AC 28 ms
89,252 KB
testcase_05 AC 29 ms
89,316 KB
testcase_06 AC 28 ms
89,284 KB
testcase_07 AC 28 ms
89,248 KB
testcase_08 AC 29 ms
89,224 KB
testcase_09 AC 29 ms
89,380 KB
testcase_10 AC 29 ms
89,224 KB
testcase_11 AC 28 ms
89,292 KB
testcase_12 AC 28 ms
89,312 KB
testcase_13 AC 28 ms
89,356 KB
testcase_14 AC 28 ms
89,288 KB
testcase_15 AC 29 ms
89,316 KB
testcase_16 AC 29 ms
89,220 KB
testcase_17 AC 28 ms
89,292 KB
testcase_18 AC 28 ms
89,240 KB
testcase_19 AC 29 ms
89,272 KB
testcase_20 AC 29 ms
89,284 KB
testcase_21 AC 29 ms
89,396 KB
testcase_22 AC 29 ms
89,248 KB
testcase_23 AC 29 ms
89,608 KB
testcase_24 AC 29 ms
89,424 KB
testcase_25 AC 29 ms
89,288 KB
testcase_26 AC 30 ms
89,484 KB
testcase_27 AC 28 ms
89,284 KB
testcase_28 AC 29 ms
89,424 KB
testcase_29 AC 28 ms
89,252 KB
testcase_30 AC 29 ms
89,276 KB
testcase_31 AC 29 ms
89,288 KB
testcase_32 AC 29 ms
89,356 KB
testcase_33 AC 29 ms
89,220 KB
testcase_34 AC 28 ms
89,428 KB
testcase_35 AC 213 ms
89,276 KB
testcase_36 AC 109 ms
89,276 KB
testcase_37 AC 123 ms
89,352 KB
testcase_38 AC 123 ms
89,288 KB
testcase_39 AC 107 ms
89,252 KB
testcase_40 AC 136 ms
89,244 KB
testcase_41 AC 196 ms
89,352 KB
testcase_42 AC 118 ms
89,220 KB
testcase_43 AC 93 ms
89,312 KB
testcase_44 AC 160 ms
89,364 KB
testcase_45 AC 170 ms
89,372 KB
testcase_46 AC 204 ms
89,292 KB
testcase_47 AC 58 ms
89,312 KB
testcase_48 AC 206 ms
89,252 KB
testcase_49 AC 175 ms
89,244 KB
testcase_50 AC 49 ms
89,368 KB
testcase_51 AC 96 ms
89,228 KB
testcase_52 AC 222 ms
89,480 KB
testcase_53 AC 227 ms
89,272 KB
testcase_54 AC 220 ms
89,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N;
    cin>>N;
    long long dp[1000005][11],mod=1000000007,ans=0;
    for(int i=0;i<=1000004;i++){
        for(int j=0;j<=9;j++){
            dp[i][j]=0;
        }
    }
    for(int i=0;i<=9;i++){
        dp[0][i]=1;
    }
    for(int i=1;i<=N;i++){
        for(int j=0;j<=9;j++){
            for(int k=0;k<=9;k++){
                if(j>=k){
                    dp[i][j]+=dp[i-1][k];
                    dp[i][j]%=mod;
                }
            }
        }
    }
    ans=0;
    for(int i=0;i<=9;i++){
        ans+=dp[N-1][i];
    }
    ans%=mod;
    cout<<ans<<endl;
    return 0;
}
0