結果
問題 |
No.1367 文字列門松
|
ユーザー |
![]() |
提出日時 | 2021-01-31 15:53:45 |
言語 | TypeScript (5.7.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 371 bytes |
コンパイル時間 | 8,846 ms |
コンパイル使用メモリ | 228,528 KB |
実行使用メモリ | 41,588 KB |
最終ジャッジ日時 | 2024-12-31 16:22:49 |
合計ジャッジ時間 | 10,724 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 27 |
ソースコード
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"));