結果

問題 No.716 距離
ユーザー 👑 obakyanobakyan
提出日時 2019-03-27 23:00:03
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 13:47:50
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 2 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
5,376 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 2 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 1 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = io.read("*n")
prev, f = nil, 0
min = 0
for i = 1, n do
    a = io.read("*n")
    if(prev == nil) then
        prev, f = a, a
    else
        if(min == 0) then min = a - prev else min = math.min(min, a - prev) end
        prev = a
    end
end
io.write(string.format("%d\n%d\n", min, prev - f))
0