結果

問題 No.1446 ハンバーグと納豆ごはん
コンテスト
ユーザー obakyan
提出日時 2021-05-17 13:00:35
言語 Lua
(LuaJit 2.1.1787165859)
コンパイル:
luajit -b _filename_ a.out
実行:
luajit _filename_
結果
AC  
実行時間 1 ms / 2,000 ms
+ 146µs
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 71 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-11 01:59:59
合計ジャッジ時間 2,218 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]

local function lltonumber(str)
  return C.atoll(str)
end

a, b, c, d = io.read():match("(%d+) (%d+) (%d+) (%d+)")
a = lltonumber(a)
b = lltonumber(b)
c = lltonumber(c)
d = lltonumber(d)

if b < a then
  a, b = b, a
  c, d = d, c
end

local lim = (b - a) / (d + 1LL)
local ret = a + lim
ret = tostring(ret):gsub("LL", "")
print(ret)
0