結果

問題 No.741 AscNumber(Easy)
ユーザー dnishdnish
提出日時 2018-10-13 14:53:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 769 bytes
コンパイル時間 1,608 ms
コンパイル使用メモリ 162,344 KB
実行使用メモリ 81,664 KB
最終ジャッジ日時 2024-04-20 20:03:25
合計ジャッジ時間 5,227 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 156 ms
78,080 KB
testcase_36 AC 68 ms
35,840 KB
testcase_37 AC 80 ms
41,728 KB
testcase_38 AC 78 ms
41,088 KB
testcase_39 AC 67 ms
35,456 KB
testcase_40 AC 91 ms
46,848 KB
testcase_41 AC 153 ms
71,296 KB
testcase_42 AC 82 ms
39,424 KB
testcase_43 AC 57 ms
29,440 KB
testcase_44 AC 113 ms
56,832 KB
testcase_45 AC 131 ms
60,928 KB
testcase_46 AC 153 ms
74,368 KB
testcase_47 AC 26 ms
15,616 KB
testcase_48 AC 150 ms
74,368 KB
testcase_49 AC 124 ms
62,720 KB
testcase_50 AC 18 ms
11,648 KB
testcase_51 AC 58 ms
30,848 KB
testcase_52 AC 177 ms
81,664 KB
testcase_53 AC 169 ms
81,664 KB
testcase_54 AC 162 ms
80,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=n; i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

ll N;
ll ans;
ll dp[1000010][10];
int main() {
    cin>>N;
    dp[0][0]=1;
    REP(i,0,N){
        REP(j,0,10){
            REP(k,j,10){
                dp[i+1][k] += dp[i][j];
                dp[i+1][k] %= mod;
            }
        }
    }
    REP(i,0,10){
        ans += dp[N][i];
        ans %= mod;
    }
    p(ans);
    return 0;
}
0