結果

問題 No.647 明太子
コンテスト
ユーザー nobigomu
提出日時 2018-05-01 12:35:00
言語 Lua
(LuaJit 2.1.1767980792)
コンパイル:
luajit -b _filename_ a.out
実行:
luajit _filename_
結果
AC  
実行時間 62 ms / 4,500 ms
コード長 519 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 390 ms
コンパイル使用メモリ 8,100 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-16 07:09:19
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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