結果
問題 | No.1367 文字列門松 |
ユーザー |
👑 |
提出日時 | 2021-05-24 15:33:32 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 6,948 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 23:49:46 |
合計ジャッジ時間 | 1,076 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
local a = "kadomatsu" local b = io.read() local t = {} for i = 1, #a + 1 do t[i] = {} for j = 1, #b + 1 do t[i][j] = false end end t[1][1] = true for i = 1, #a + 1 do for j = 1, #b + 1 do if t[i][j] then if i < #a + 1 then t[i + 1][j] = true end if i < #a + 1 and j < #b + 1 then if a:sub(i, i) == b:sub(j, j) then t[i + 1][j + 1] = true end end end end end print(t[#a + 1][#b + 1] and "Yes" or "No")