結果

問題 No.2420 Simple Problem
ユーザー nikoro256
提出日時 2023-08-12 14:24:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 290 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,036 KB
実行使用メモリ 77,464 KB
最終ジャッジ日時 2024-11-19 19:18:45
合計ジャッジ時間 41,753 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
for _ in range(N):
    A,B=map(int,input().split())
    left,right=(math.sqrt(A+B)-1)//1+1,7*10**4
    while right-left>1:
        mid=(right+left)//2
        if 4*A*B<(mid**2-A-B)**2:
            right=mid
        else:
            left=mid
    print(int(right))
0