結果

問題 No.647 明太子
ユーザー nobigomunobigomu
提出日時 2018-05-01 12:35:00
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 81 ms / 4,500 ms
コード長 519 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-10 08:38:20
合計ジャッジ時間 1,657 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

local ffi = require 'ffi'
local C = ffi.C
ffi.cdef 'int scanf(const char *, ...);'

do
local st,pt=ffi.typeof("int32_t[2]"),ffi.typeof("int32_t[1]")

local a,t,u,n={},pt(),pt(),io.stdin:read("*n")
for i=1,n do C.scanf("%d %d",t,u) a[i]=st(t[0],u[0]) end

local b,k,m={},0,io.stdin:read("*n")
for i=1,m do
	b[i]=0 C.scanf("%d %d",t,u)
	for j=1,n do if t[0]<=a[j][0] and u[0]>=a[j][1] then b[i]=b[i]+1 end end
	if b[i]>k then k=b[i] end
end
if k==0 then print(0) else for i=1,m do if k==b[i] then print(i) end end end
end
0