結果
問題 | No.2420 Simple Problem |
ユーザー |
👑 |
提出日時 | 2023-08-12 14:01:05 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 238 ms / 2,000 ms |
コード長 | 480 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 5,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-19 17:02:13 |
合計ジャッジ時間 | 10,438 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 |
ソースコード
local mfl, mce = math.floor, math.ceillocal q = io.read("*n")local function solve(x, a, b)local v = 1LL * x * x - a - bif v < 0LL thenreturn falseendif 2000000000LL < v thenreturn trueendreturn 4LL * a * b < v * vendfor iq = 1, q dolocal a, b = io.read("*n", "*n")local l, r = 0, 1000000001while 1 < r - l dolocal mid = mfl((l + r) / 2)if solve(mid, a, b) thenr = midelsel = midendendprint(r)end