結果

問題 No.201 yukicoderじゃんけん
ユーザー 👑 obakyan
提出日時 2019-04-05 09:32:59
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 604 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-31 22:47:48
合計ジャッジ時間 1,610 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

s1 = io.read()
a, n1, y = string.match(s1, "(%w+) (%d+) (%w+)")
s2 = io.read()
b, n2, y = string.match(s2, "(%w+) (%d+) (%w+)")
len1 = string.len(n1)
len2 = string.len(n2)
if(len1 < len2) then print(b) elseif(len2 < len1) then print(a)
else
    fin = false
    for i = 1, len1 do
        x1 = tonumber(string.sub(n1, i, i))
        x2 = tonumber(string.sub(n2, i, i))
        if(x1 < x2) then
            print(b)
            fin = true
            break
        elseif(x2 < x1) then
            print(a)
            fin = true
            break
        end
    end
    if(not fin) then print(-1) end
end
0