結果

問題 No.1367 文字列門松
ユーザー jp_stejp_ste
提出日時 2021-01-31 15:54:23
言語 TypeScript
(5.2.2)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 6,798 ms
コンパイル使用メモリ 253,580 KB
実行使用メモリ 42,436 KB
最終ジャッジ日時 2023-09-11 09:57:49
合計ジャッジ時間 10,103 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
42,268 KB
testcase_01 AC 76 ms
42,280 KB
testcase_02 AC 77 ms
42,168 KB
testcase_03 AC 75 ms
42,180 KB
testcase_04 AC 77 ms
42,320 KB
testcase_05 AC 76 ms
42,176 KB
testcase_06 AC 76 ms
42,380 KB
testcase_07 AC 75 ms
42,224 KB
testcase_08 AC 74 ms
42,272 KB
testcase_09 AC 75 ms
42,376 KB
testcase_10 AC 74 ms
42,216 KB
testcase_11 AC 75 ms
42,364 KB
testcase_12 AC 76 ms
42,180 KB
testcase_13 AC 75 ms
42,212 KB
testcase_14 AC 75 ms
42,224 KB
testcase_15 AC 77 ms
42,436 KB
testcase_16 AC 76 ms
42,388 KB
testcase_17 AC 76 ms
42,324 KB
testcase_18 AC 75 ms
42,432 KB
testcase_19 AC 76 ms
42,420 KB
testcase_20 AC 74 ms
42,212 KB
testcase_21 AC 75 ms
42,436 KB
testcase_22 AC 75 ms
42,268 KB
testcase_23 AC 75 ms
42,424 KB
testcase_24 AC 76 ms
42,308 KB
testcase_25 AC 76 ms
42,168 KB
testcase_26 AC 76 ms
42,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function main(input) {
  const [s] = input;
  const arr = [];
  walk("kadomatsu", 0, "", arr);
  console.log(arr.indexOf(s) >= 0 ? "Yes" : "No");
}

function walk(s, i, v, arr) {
  arr.push(v);
  if(i >= s.length) return;
  for(let j=i; j<s.length; j++) {
    walk(s, j+1, v + s[j], arr);
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n"));
0