結果

問題 No.741 AscNumber(Easy)
ユーザー oevloevl
提出日時 2019-03-11 22:14:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 1,413 ms
コンパイル使用メモリ 163,668 KB
実行使用メモリ 81,740 KB
最終ジャッジ日時 2023-09-05 20:16:11
合計ジャッジ時間 5,694 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 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,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,384 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 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,376 KB
testcase_32 AC 2 ms
4,500 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 165 ms
77,988 KB
testcase_36 AC 73 ms
35,872 KB
testcase_37 AC 86 ms
41,580 KB
testcase_38 AC 84 ms
41,056 KB
testcase_39 AC 71 ms
35,184 KB
testcase_40 AC 95 ms
46,656 KB
testcase_41 AC 150 ms
71,288 KB
testcase_42 AC 81 ms
39,352 KB
testcase_43 AC 58 ms
29,324 KB
testcase_44 AC 118 ms
56,520 KB
testcase_45 AC 132 ms
60,872 KB
testcase_46 AC 157 ms
74,160 KB
testcase_47 AC 29 ms
15,424 KB
testcase_48 AC 159 ms
74,420 KB
testcase_49 AC 131 ms
62,520 KB
testcase_50 AC 20 ms
11,344 KB
testcase_51 AC 62 ms
30,820 KB
testcase_52 AC 174 ms
81,600 KB
testcase_53 AC 172 ms
81,740 KB
testcase_54 AC 172 ms
80,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
#define MOD 1000000007

template <class T> void add(T &a, T b) { a = (a + b) % MOD; }
ll dp[1000005][10];

int main() {
  int N;
  cin >> N;
  dp[0][0] = 1;
  rep(i, N) rep(j, 10) {
    for (int d = j; d < 10; d++) {
      add(dp[i + 1][d], dp[i][j]);
    }
  }
  ll ans = 0;
  rep(i, 10) add(ans, dp[N][i]);
  cout << ans << endl;
  return 0;
}
0