結果

問題 No.2420 Simple Problem
ユーザー nikoro256nikoro256
提出日時 2023-08-12 14:10:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 282 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2024-04-30 05:15:19
合計ジャッジ時間 58,705 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 918 ms
76,800 KB
testcase_02 AC 79 ms
72,576 KB
testcase_03 AC 389 ms
76,160 KB
testcase_04 AC 1,701 ms
76,628 KB
testcase_05 AC 1,105 ms
76,672 KB
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 40 ms
52,608 KB
testcase_33 AC 896 ms
76,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
for _ in range(N):
    A,B=map(int,input().split())
    left,right=math.sqrt(A+B)//1,10**7
    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