結果
| 問題 | No.2420 Simple Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-25 16:43:06 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 446 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 102,272 KB |
| 最終ジャッジ日時 | 2026-05-29 22:07:16 |
| 合計ジャッジ時間 | 13,792 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 TLE * 2 -- * 27 |
ソースコード
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = int(input())
for _ in range(N):
a,b = map(int,input().split())
is_ok = lambda x : 4*a*b < (x**2 - a - b)**2
x = math.ceil(math.sqrt(a+b))
y = x + 3*math.ceil(math.sqrt(a*b))
while y-x>1:
mid = (y+x)//2
if is_ok(mid):
y = mid
else:
x = mid
print(y)