結果

問題 No.1199 お菓子配り-2
ユーザー 👑 obakyanobakyan
提出日時 2021-02-21 15:48:40
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 239 ms / 1,000 ms
コード長 389 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 4,988 KB
実行使用メモリ 5,044 KB
最終ジャッジ日時 2023-10-19 17:32:46
合計ジャッジ時間 15,128 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,984 KB
testcase_01 AC 2 ms
4,988 KB
testcase_02 AC 1 ms
4,988 KB
testcase_03 AC 60 ms
5,028 KB
testcase_04 AC 149 ms
5,028 KB
testcase_05 AC 6 ms
4,988 KB
testcase_06 AC 9 ms
4,972 KB
testcase_07 AC 73 ms
4,972 KB
testcase_08 AC 100 ms
4,988 KB
testcase_09 AC 60 ms
5,028 KB
testcase_10 AC 16 ms
4,972 KB
testcase_11 AC 47 ms
5,028 KB
testcase_12 AC 47 ms
4,988 KB
testcase_13 AC 17 ms
4,988 KB
testcase_14 AC 14 ms
4,972 KB
testcase_15 AC 13 ms
4,988 KB
testcase_16 AC 97 ms
4,972 KB
testcase_17 AC 47 ms
4,972 KB
testcase_18 AC 101 ms
4,972 KB
testcase_19 AC 27 ms
4,972 KB
testcase_20 AC 179 ms
4,972 KB
testcase_21 AC 111 ms
4,988 KB
testcase_22 AC 58 ms
4,972 KB
testcase_23 AC 83 ms
4,988 KB
testcase_24 AC 113 ms
5,028 KB
testcase_25 AC 18 ms
4,988 KB
testcase_26 AC 127 ms
4,972 KB
testcase_27 AC 103 ms
4,972 KB
testcase_28 AC 236 ms
4,988 KB
testcase_29 AC 236 ms
4,988 KB
testcase_30 AC 237 ms
4,972 KB
testcase_31 AC 236 ms
4,988 KB
testcase_32 AC 237 ms
5,028 KB
testcase_33 AC 237 ms
4,988 KB
testcase_34 AC 237 ms
4,972 KB
testcase_35 AC 236 ms
5,028 KB
testcase_36 AC 234 ms
4,988 KB
testcase_37 AC 236 ms
4,972 KB
testcase_38 AC 238 ms
4,972 KB
testcase_39 AC 239 ms
4,988 KB
testcase_40 AC 236 ms
4,988 KB
testcase_41 AC 235 ms
4,972 KB
testcase_42 AC 236 ms
4,972 KB
testcase_43 AC 237 ms
5,028 KB
testcase_44 AC 237 ms
5,028 KB
testcase_45 AC 237 ms
5,028 KB
testcase_46 AC 238 ms
5,044 KB
testcase_47 AC 236 ms
4,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n, m = io.read("*n", "*n")
local a = {}
for i = 1, n do
  local v = 0
  for j = 1, m do
    v = v + io.read("*n")
  end
  a[i] = v
end
local v1, v2 = 0LL, a[1] * 1LL
for i = 2, n do
  local c2 = v1 + a[i] * 1LL
  local c1 = v2 - a[i] * 1LL
  if v2 < c2 then v2 = c2 end
  if v1 < c1 then v1 = c1 end
end
local ret = v1 < v2 and v2 or v1
ret = tostring(ret):gsub("LL", "")
print(ret)
0