結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー 👑 obakyan
提出日時 2019-04-01 09:21:32
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 6,824 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 14:52:28
合計ジャッジ時間 1,010 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

isok = true
for i = 1, 2 do
    s = io.read()
    n = string.len(s)
    if(n <= 5) then
        if(s ~= "0") then
            for j = 1, n do
                ss = string.sub(s, j, j)
                if(j == 1) then
                    if(string.match(ss, "[1-9]") == nil) then
                        isok = false
                    end
                else
                    if(string.match(ss, "[0-9]") == nil) then
                        isok = false
                    end
                end
            end
            if(isok) then
                snum = tonumber(s)
                if(12345 < snum) then isok = false end
            end
        end
    else
        isok = false
    end
end
if(isok) then print("OK") else print("NG") end
0