結果

問題 No.741 AscNumber(Easy)
ユーザー OtaWatanabeOtaWatanabe
提出日時 2024-04-27 13:34:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 1,654 ms
コンパイル使用メモリ 166,396 KB
実行使用メモリ 159,672 KB
最終ジャッジ日時 2024-04-27 13:34:43
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 3 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 3 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 2 ms
6,944 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 2 ms
6,944 KB
testcase_28 AC 3 ms
6,940 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 3 ms
6,944 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 3 ms
6,944 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 96 ms
152,848 KB
testcase_36 AC 35 ms
69,188 KB
testcase_37 AC 43 ms
81,800 KB
testcase_38 AC 41 ms
80,464 KB
testcase_39 AC 35 ms
68,124 KB
testcase_40 AC 46 ms
91,508 KB
testcase_41 AC 79 ms
139,884 KB
testcase_42 AC 39 ms
77,224 KB
testcase_43 AC 28 ms
56,932 KB
testcase_44 AC 56 ms
110,452 KB
testcase_45 AC 60 ms
119,052 KB
testcase_46 AC 86 ms
147,092 KB
testcase_47 AC 14 ms
30,108 KB
testcase_48 AC 83 ms
145,592 KB
testcase_49 AC 62 ms
122,312 KB
testcase_50 AC 11 ms
22,984 KB
testcase_51 AC 29 ms
60,968 KB
testcase_52 AC 98 ms
159,672 KB
testcase_53 AC 101 ms
159,660 KB
testcase_54 AC 98 ms
158,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  long long dp[1000000][10], cd[1000000][10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 10; ++j) {
      if (i == 0) dp[i][j] = 1;
      else dp[i][j] = cd[i-1][j];
      if (j == 0) cd[i][j] = dp[i][j];
      else cd[i][j] = cd[i][j-1] + dp[i][j];
      cd[i][j] %= 1000000007;
      dp[i][j] %= 1000000007;
    }
  }
  cout << cd[n-1][9] << '\n';
}
0