結果

問題 No.2420 Simple Problem
ユーザー AngrySadEightAngrySadEight
提出日時 2023-08-12 13:59:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 675 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-30 04:41:20
合計ジャッジ時間 21,580 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 AC 299 ms
75,776 KB
testcase_02 AC 58 ms
68,992 KB
testcase_03 AC 151 ms
76,160 KB
testcase_04 AC 550 ms
75,904 KB
testcase_05 AC 355 ms
76,288 KB
testcase_06 AC 643 ms
76,032 KB
testcase_07 AC 648 ms
76,032 KB
testcase_08 AC 646 ms
75,956 KB
testcase_09 AC 654 ms
76,032 KB
testcase_10 AC 672 ms
76,032 KB
testcase_11 AC 642 ms
76,544 KB
testcase_12 AC 643 ms
76,176 KB
testcase_13 AC 648 ms
75,904 KB
testcase_14 AC 650 ms
76,032 KB
testcase_15 AC 649 ms
76,032 KB
testcase_16 AC 644 ms
76,160 KB
testcase_17 AC 649 ms
76,032 KB
testcase_18 AC 655 ms
75,776 KB
testcase_19 AC 661 ms
76,032 KB
testcase_20 AC 635 ms
76,324 KB
testcase_21 AC 642 ms
76,288 KB
testcase_22 AC 643 ms
76,184 KB
testcase_23 AC 637 ms
75,904 KB
testcase_24 AC 631 ms
76,264 KB
testcase_25 AC 675 ms
76,672 KB
testcase_26 AC 37 ms
52,480 KB
testcase_27 AC 518 ms
76,032 KB
testcase_28 AC 521 ms
75,844 KB
testcase_29 AC 547 ms
76,292 KB
testcase_30 AC 527 ms
76,160 KB
testcase_31 AC 529 ms
76,032 KB
testcase_32 AC 34 ms
51,840 KB
testcase_33 AC 298 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
for i in range(N):
    A, B = map(int, input().split())

    ng = 0
    ok = 100000
    while ok - ng > 1:
        mid = (ok + ng) // 2
        if 4 * A * B < (mid * mid - A - B) * (mid * mid - A - B) and mid * mid - A - B > 0:
            ok = mid
        else:
            ng = mid
    print(ok)
0