結果

問題 No.741 AscNumber(Easy)
ユーザー yuki2006yuki2006
提出日時 2018-10-13 16:21:21
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 1,153 ms / 2,000 ms
コード長 755 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 182,684 KB
最終ジャッジ日時 2024-04-21 02:19:27
合計ジャッジ時間 62,608 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,079 ms
182,428 KB
testcase_01 AC 1,097 ms
182,428 KB
testcase_02 AC 1,082 ms
182,684 KB
testcase_03 AC 1,082 ms
182,424 KB
testcase_04 AC 1,083 ms
182,428 KB
testcase_05 AC 1,081 ms
182,424 KB
testcase_06 AC 1,074 ms
182,424 KB
testcase_07 AC 1,153 ms
182,428 KB
testcase_08 AC 1,080 ms
182,428 KB
testcase_09 AC 1,085 ms
182,424 KB
testcase_10 AC 1,089 ms
182,428 KB
testcase_11 AC 1,097 ms
182,428 KB
testcase_12 AC 1,086 ms
182,428 KB
testcase_13 AC 1,097 ms
182,428 KB
testcase_14 AC 1,084 ms
182,684 KB
testcase_15 AC 1,073 ms
182,552 KB
testcase_16 AC 1,085 ms
182,296 KB
testcase_17 AC 1,092 ms
182,428 KB
testcase_18 AC 1,084 ms
182,556 KB
testcase_19 AC 1,070 ms
182,684 KB
testcase_20 AC 1,082 ms
182,428 KB
testcase_21 AC 1,084 ms
182,428 KB
testcase_22 AC 1,090 ms
182,424 KB
testcase_23 AC 1,077 ms
182,300 KB
testcase_24 AC 1,070 ms
182,556 KB
testcase_25 AC 1,084 ms
182,428 KB
testcase_26 AC 1,079 ms
182,556 KB
testcase_27 AC 1,061 ms
182,428 KB
testcase_28 AC 1,075 ms
182,680 KB
testcase_29 AC 1,065 ms
182,428 KB
testcase_30 AC 1,082 ms
182,424 KB
testcase_31 AC 1,076 ms
182,428 KB
testcase_32 AC 1,083 ms
182,556 KB
testcase_33 AC 1,087 ms
182,428 KB
testcase_34 AC 1,085 ms
182,680 KB
testcase_35 AC 1,080 ms
182,428 KB
testcase_36 AC 1,088 ms
182,432 KB
testcase_37 AC 1,084 ms
182,428 KB
testcase_38 AC 1,065 ms
182,432 KB
testcase_39 AC 1,084 ms
182,552 KB
testcase_40 AC 1,086 ms
182,428 KB
testcase_41 AC 1,077 ms
182,680 KB
testcase_42 AC 1,082 ms
182,556 KB
testcase_43 AC 1,053 ms
182,680 KB
testcase_44 AC 1,083 ms
182,552 KB
testcase_45 AC 1,071 ms
182,684 KB
testcase_46 AC 1,079 ms
182,424 KB
testcase_47 AC 1,067 ms
182,684 KB
testcase_48 AC 1,076 ms
182,432 KB
testcase_49 AC 1,075 ms
182,684 KB
testcase_50 AC 1,066 ms
182,552 KB
testcase_51 AC 1,070 ms
182,556 KB
testcase_52 AC 1,076 ms
182,424 KB
testcase_53 AC 1,079 ms
182,428 KB
testcase_54 AC 1,088 ms
182,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
  // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。
  const data = input.trim() - 0;

  let dp = new Array(1000000);
  for (let i = 0; i < dp.length; i++) {
    dp[i] = new Array(10);
    dp[i].fill(0);
  }

  for (let j = 0; j < 10; j++) {
    dp[0][j] = 1;
  }

  for (let i = 1; i < dp.length; i++) {
    for (let j = 0; j < 10; j++) {
      for (let k = 0; k <= j; k++) {
        dp[i][j] += dp[i - 1][k];
        dp[i][j] %= 1000000007;
      }
    }
  }

  let ans = dp[data - 1].reduce((p, v) => {
    return (p + v) % 1000000007;
  }, 0);
  console.log(ans);
}

// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

0