結果

問題 No.1367 文字列門松
コンテスト
ユーザー jp_ste
提出日時 2021-01-31 15:54:23
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 371 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,068 ms
コンパイル使用メモリ 349,096 KB
最終ジャッジ日時 2026-06-05 04:50:31
合計ジャッジ時間 5,776 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.ts(2,15): error TS7006: Parameter 'input' implicitly has an 'any' type.
main.ts(4,9): error TS7034: Variable 'arr' implicitly has type 'any[]' in some locations where its type cannot be determined.
main.ts(5,28): error TS7005: Variable 'arr' implicitly has an 'any[]' type.
main.ts(6,15): error TS7005: Variable 'arr' implicitly has an 'any[]' type.
main.ts(9,15): error TS7006: Parameter 's' implicitly has an 'any' type.
main.ts(9,18): error TS7006: Parameter 'i' implicitly has an 'any' type.
main.ts(9,21): error TS7006: Parameter 'v' implicitly has an 'any' type.
main.ts(9,24): error TS7006: Parameter 'arr' implicitly has an 'any' type.

ソースコード

diff #
raw source code

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