結果

問題 No.741 AscNumber(Easy)
ユーザー Grun1396Grun1396
提出日時 2019-03-05 07:51:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 693 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 72,480 KB
実行使用メモリ 81,492 KB
最終ジャッジ日時 2023-09-05 18:40:49
合計ジャッジ時間 4,673 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 167 ms
77,868 KB
testcase_36 AC 74 ms
35,836 KB
testcase_37 AC 87 ms
41,532 KB
testcase_38 AC 86 ms
41,016 KB
testcase_39 AC 73 ms
35,228 KB
testcase_40 AC 98 ms
46,644 KB
testcase_41 AC 157 ms
71,312 KB
testcase_42 AC 82 ms
39,376 KB
testcase_43 AC 60 ms
29,332 KB
testcase_44 AC 122 ms
56,660 KB
testcase_45 AC 129 ms
60,668 KB
testcase_46 AC 159 ms
74,204 KB
testcase_47 AC 29 ms
15,536 KB
testcase_48 AC 159 ms
74,196 KB
testcase_49 AC 132 ms
62,488 KB
testcase_50 AC 21 ms
11,392 KB
testcase_51 AC 64 ms
30,788 KB
testcase_52 AC 176 ms
81,492 KB
testcase_53 AC 176 ms
81,456 KB
testcase_54 AC 173 ms
80,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <string>
#include <utility>
#include <queue>
#include <string>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;
const int mod = 1e9+7;

ll dp[1000002][10];

int main(){
    int n;
    cin >> n;
    rep(i,10) dp[1][i] = 1;

    rep(i,n+1){
        rep(j,10){
            rep(k,j+1){
                dp[i+1][k] = (dp[i][j] + dp[i+1][k]) % mod;
            }
        }
    }

    ll ans = 0;
    rep(i,10){
        ans = (ans + dp[n][i]) % mod;
    }
    cout << ans << endl;

    return 0;
}
0