結果
| 問題 | No.653 E869120 and Lucky Numbers | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2019-06-11 23:28:26 | 
| 言語 | Lua (LuaJit 2.1.1734355927) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 519 bytes | 
| コンパイル時間 | 290 ms | 
| コンパイル使用メモリ | 5,248 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-07 23:59:58 | 
| 合計ジャッジ時間 | 1,369 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 WA * 1 | 
ソースコード
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
    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")
            
            
            
        