結果
問題 |
No.653 E869120 and Lucky Numbers
|
ユーザー |
👑 |
提出日時 | 2019-06-11 23:29:11 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 366 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 18:20:18 |
合計ジャッジ時間 | 1,399 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
local str = io.read() local n = #str local t = {} for i = 1, n do t[i] = tonumber(str:sub(n + 1 - i, n + 1 - i)) end local ret = true local solo = false for i = 1, n - 1 do if 2 <= t[i] and t[i] <= 4 then if solo then ret = false break else t[i + 1] = t[i + 1] - 1 end elseif t[i] == 6 or t[i] == 7 then if i == 1 then ret = false break end solo = true else ret = false break end end if ret then if t[n] == 0 or t[n] == 6 or t[n] == 7 then else ret = false end end print(ret and "Yes" or "No")