結果

問題 No.1137 Circles
ユーザー 👑 obakyanobakyan
提出日時 2020-11-16 22:32:04
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 487 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 10,932 KB
最終ジャッジ日時 2023-09-30 07:31:42
合計ジャッジ時間 2,920 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
10,260 KB
testcase_01 AC 48 ms
10,136 KB
testcase_02 AC 10 ms
10,332 KB
testcase_03 AC 25 ms
10,240 KB
testcase_04 AC 34 ms
10,228 KB
testcase_05 AC 11 ms
10,240 KB
testcase_06 AC 36 ms
10,136 KB
testcase_07 AC 20 ms
10,184 KB
testcase_08 AC 42 ms
10,140 KB
testcase_09 AC 16 ms
10,252 KB
testcase_10 AC 22 ms
10,244 KB
testcase_11 AC 26 ms
10,372 KB
testcase_12 AC 45 ms
10,260 KB
testcase_13 AC 17 ms
10,240 KB
testcase_14 AC 44 ms
10,240 KB
testcase_15 AC 20 ms
10,932 KB
testcase_16 AC 25 ms
10,212 KB
testcase_17 AC 9 ms
10,192 KB
testcase_18 AC 37 ms
10,240 KB
testcase_19 AC 18 ms
10,248 KB
testcase_20 AC 15 ms
10,132 KB
testcase_21 AC 7 ms
10,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local t = {}
local offset = 200001
for i = 1, 800004 do
  t[i] = 0
end
local n = io.read("*n")
for i = 1, n do
  local x, r = io.read("*n", "*n")
  x = x + offset
  t[(x - r) * 2 + 1] = t[(x - r) * 2 + 1] + 1
  t[(x + r) * 2] = t[(x + r) * 2] - 1
end
local ret = 0
for i = 2, 800004 do
  t[i] = t[i] + t[i - 1]
  if ret < t[i] then ret = t[i] end
end
print(ret)
0