結果

問題 No.201 yukicoderじゃんけん
ユーザー 👑 obakyanobakyan
提出日時 2019-04-05 09:32:59
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 604 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 5,364 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-30 08:03:38
合計ジャッジ時間 1,194 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,384 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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