結果

問題 No.647 明太子
ユーザー 👑 obakyanobakyan
提出日時 2019-04-15 14:26:30
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 79 ms / 4,500 ms
コード長 451 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 06:36:37
合計ジャッジ時間 2,028 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 5 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 4 ms
4,348 KB
testcase_13 AC 7 ms
4,348 KB
testcase_14 AC 58 ms
4,348 KB
testcase_15 AC 10 ms
4,348 KB
testcase_16 AC 4 ms
4,348 KB
testcase_17 AC 79 ms
4,348 KB
testcase_18 AC 76 ms
4,348 KB
testcase_19 AC 8 ms
4,348 KB
testcase_20 AC 7 ms
4,348 KB
testcase_21 AC 4 ms
4,348 KB
testcase_22 AC 26 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read("*n")
local a = {}
local b = {}
for i = 1, n do
  a[i], b[i] = io.read("*n", "*n")
end
local m = io.read("*n")
local ms = {}
max = 0
for j = 1, m do
  local cnt = 0
  local c, d = io.read("*n", "*n")
  for i = 1, n do
    if(c <= a[i] and b[i] <= d) then
      cnt = cnt + 1
    end
  end
  ms[j] = cnt
  max = math.max(max, cnt)
end
if(max == 0) then print(0) else
  for j = 1, m do
    if(ms[j] == max) then print(j) end
  end
end
0