結果

問題 No.653 E869120 and Lucky Numbers
ユーザー 👑 obakyan
提出日時 2019-06-11 23:24:16
言語 Lua
(LuaJit 2.1.1734355927)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-07 23:48:43
合計ジャッジ時間 1,082 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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
for i = 1, n - 1 do
  if 2 <= t[i] and t[i] <= 4 then
    t[i + 1] = t[i + 1] - 1
  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")
0