結果

問題 No.2420 Simple Problem
ユーザー nikoro256nikoro256
提出日時 2023-08-12 14:20:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 77,180 KB
最終ジャッジ日時 2024-04-30 05:48:47
合計ジャッジ時間 41,766 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,968 KB
testcase_01 AC 638 ms
76,896 KB
testcase_02 AC 70 ms
74,476 KB
testcase_03 AC 272 ms
76,776 KB
testcase_04 AC 1,187 ms
76,940 KB
testcase_05 AC 741 ms
76,400 KB
testcase_06 AC 1,405 ms
76,740 KB
testcase_07 AC 1,398 ms
76,880 KB
testcase_08 AC 1,394 ms
76,672 KB
testcase_09 AC 1,412 ms
76,684 KB
testcase_10 AC 1,469 ms
76,892 KB
testcase_11 AC 1,428 ms
77,108 KB
testcase_12 AC 1,432 ms
76,892 KB
testcase_13 AC 1,442 ms
76,688 KB
testcase_14 AC 1,474 ms
76,824 KB
testcase_15 AC 1,432 ms
77,156 KB
testcase_16 AC 1,431 ms
76,764 KB
testcase_17 AC 1,415 ms
76,888 KB
testcase_18 AC 1,433 ms
76,784 KB
testcase_19 AC 1,381 ms
77,012 KB
testcase_20 AC 1,387 ms
76,880 KB
testcase_21 AC 1,395 ms
77,096 KB
testcase_22 AC 1,394 ms
76,684 KB
testcase_23 AC 1,399 ms
77,032 KB
testcase_24 AC 1,380 ms
76,780 KB
testcase_25 AC 1,447 ms
76,532 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 32 ms
52,720 KB
testcase_33 AC 601 ms
76,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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