結果

問題 No.2420 Simple Problem
ユーザー lloyzlloyz
提出日時 2023-08-24 01:22:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 673 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 86,620 KB
実行使用メモリ 77,568 KB
最終ジャッジ日時 2023-08-24 01:22:54
合計ジャッジ時間 23,477 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,036 KB
testcase_01 AC 311 ms
77,388 KB
testcase_02 AC 87 ms
76,584 KB
testcase_03 AC 171 ms
77,260 KB
testcase_04 AC 536 ms
77,144 KB
testcase_05 AC 375 ms
77,160 KB
testcase_06 AC 645 ms
77,568 KB
testcase_07 AC 656 ms
77,280 KB
testcase_08 AC 644 ms
77,220 KB
testcase_09 AC 631 ms
77,320 KB
testcase_10 AC 673 ms
77,372 KB
testcase_11 AC 636 ms
77,020 KB
testcase_12 AC 633 ms
77,140 KB
testcase_13 AC 647 ms
77,192 KB
testcase_14 AC 630 ms
77,252 KB
testcase_15 AC 649 ms
77,268 KB
testcase_16 AC 630 ms
77,056 KB
testcase_17 AC 662 ms
77,256 KB
testcase_18 AC 646 ms
77,260 KB
testcase_19 AC 646 ms
77,220 KB
testcase_20 AC 646 ms
77,232 KB
testcase_21 AC 645 ms
77,228 KB
testcase_22 AC 659 ms
77,344 KB
testcase_23 AC 630 ms
77,240 KB
testcase_24 AC 650 ms
77,244 KB
testcase_25 AC 658 ms
77,444 KB
testcase_26 AC 69 ms
71,328 KB
testcase_27 AC 519 ms
76,952 KB
testcase_28 AC 531 ms
77,252 KB
testcase_29 AC 550 ms
77,364 KB
testcase_30 AC 527 ms
76,948 KB
testcase_31 AC 529 ms
77,340 KB
testcase_32 AC 67 ms
71,168 KB
testcase_33 AC 315 ms
77,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    a, b = map(int, input().split())
    ok = 70000
    ng = 2
    while ok - ng > 1:
        mid = (ok + ng) // 2
        res = mid * mid - a - b
        if res * res > 4 * a * b and mid * mid > a + b:
            ok = mid
        else:
            ng = mid
    print(ok)
0