結果

問題 No.609 Noelちゃんと星々
ユーザー 👑 obakyanobakyan
提出日時 2019-04-08 16:28:58
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 15:42:21
合計ジャッジ時間 3,662 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
4,376 KB
testcase_01 AC 31 ms
4,380 KB
testcase_02 AC 21 ms
4,376 KB
testcase_03 AC 28 ms
4,376 KB
testcase_04 AC 14 ms
4,376 KB
testcase_05 AC 80 ms
4,376 KB
testcase_06 AC 68 ms
4,376 KB
testcase_07 AC 38 ms
4,376 KB
testcase_08 AC 8 ms
4,376 KB
testcase_09 AC 24 ms
4,376 KB
testcase_10 AC 49 ms
4,376 KB
testcase_11 AC 45 ms
4,376 KB
testcase_12 AC 58 ms
4,380 KB
testcase_13 AC 10 ms
4,380 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 AC 69 ms
4,380 KB
testcase_16 AC 81 ms
4,376 KB
testcase_17 AC 62 ms
4,380 KB
testcase_18 AC 20 ms
4,380 KB
testcase_19 AC 66 ms
4,380 KB
testcase_20 AC 84 ms
4,376 KB
testcase_21 AC 84 ms
4,376 KB
testcase_22 AC 83 ms
4,376 KB
testcase_23 AC 85 ms
4,380 KB
testcase_24 AC 84 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = io.read("*n")
t = {}
for i = 1, n do
  table.insert(t, io.read("*n"))
end
table.sort(t)
spos, epos = 1, #t
len = 0
while(spos <= epos) do
  len = len + t[epos] - t[spos]
  spos, epos = spos + 1, epos - 1
end
print(len)
0