結果

問題 No.2607 Add One Digit
ユーザー Maksym ShcherbanMaksym Shcherban
提出日時 2024-01-19 21:29:49
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 360 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 6,548 KB
実行使用メモリ 37,888 KB
最終ジャッジ日時 2024-01-19 21:29:53
合計ジャッジ時間 3,614 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
37,760 KB
testcase_01 AC 69 ms
37,760 KB
testcase_02 AC 68 ms
37,760 KB
testcase_03 AC 68 ms
37,760 KB
testcase_04 AC 68 ms
37,760 KB
testcase_05 AC 68 ms
37,760 KB
testcase_06 AC 68 ms
37,760 KB
testcase_07 AC 69 ms
37,760 KB
testcase_08 AC 69 ms
37,760 KB
testcase_09 AC 69 ms
37,760 KB
testcase_10 AC 69 ms
37,760 KB
testcase_11 AC 69 ms
37,760 KB
testcase_12 AC 71 ms
37,760 KB
testcase_13 AC 69 ms
37,760 KB
testcase_14 AC 69 ms
37,760 KB
testcase_15 AC 68 ms
37,760 KB
testcase_16 AC 68 ms
37,760 KB
testcase_17 AC 69 ms
37,888 KB
testcase_18 AC 69 ms
37,760 KB
testcase_19 AC 70 ms
37,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const n = +require("fs").readFileSync("/dev/stdin", "utf8");

const result = new Set();
const digits = [...`${n}`];
for (let i = 0; i <= digits.length; i++) {
  for (let j = i === 0 ? 1 : 0; j < 10; j++) {
    const next = [
      ...digits.slice(0, i),
      j,
      ...digits.slice(i),
    ];
    result.add(next.join(''));
  }
}

console.log(result.size);
0