結果

問題 No.741 AscNumber(Easy)
ユーザー どららどらら
提出日時 2018-10-05 22:07:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 641 bytes
コンパイル時間 1,451 ms
コンパイル使用メモリ 164,360 KB
実行使用メモリ 81,456 KB
最終ジャッジ日時 2023-08-02 17:08:34
合計ジャッジ時間 5,686 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,384 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,384 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 167 ms
77,840 KB
testcase_36 AC 75 ms
35,820 KB
testcase_37 AC 88 ms
41,568 KB
testcase_38 AC 87 ms
41,088 KB
testcase_39 AC 74 ms
35,260 KB
testcase_40 AC 99 ms
46,632 KB
testcase_41 AC 155 ms
71,328 KB
testcase_42 AC 83 ms
39,420 KB
testcase_43 AC 60 ms
29,356 KB
testcase_44 AC 120 ms
56,536 KB
testcase_45 AC 130 ms
60,724 KB
testcase_46 AC 162 ms
74,276 KB
testcase_47 AC 29 ms
15,440 KB
testcase_48 AC 160 ms
74,504 KB
testcase_49 AC 135 ms
62,632 KB
testcase_50 AC 20 ms
11,388 KB
testcase_51 AC 64 ms
30,684 KB
testcase_52 AC 176 ms
81,456 KB
testcase_53 AC 175 ms
81,444 KB
testcase_54 AC 177 ms
80,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

static const ll MOD = 1000000007LL;

ll dp[10][1000005];

int main(){
  int N;
  cin >> N;

  dp[0][0] = 1;
  rep(i,N){
    rep(j,10){
      REP(k,j,10){
        dp[k][i+1] += dp[j][i];
        dp[k][i+1] %= MOD;
      }
    }
  }

  ll ret = 0;
  rep(i,10){
    ret += dp[i][N];
    ret %= MOD;
  }

  cout << ret << endl;
  
  return 0;
}
0