結果

問題 No.2420 Simple Problem
ユーザー 👑 potato167potato167
提出日時 2023-08-12 13:41:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 695 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-30 03:48:40
合計ジャッジ時間 22,835 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,456 KB
testcase_01 AC 332 ms
76,544 KB
testcase_02 AC 78 ms
68,992 KB
testcase_03 AC 179 ms
75,904 KB
testcase_04 AC 574 ms
76,288 KB
testcase_05 AC 397 ms
75,904 KB
testcase_06 AC 678 ms
76,288 KB
testcase_07 AC 677 ms
75,904 KB
testcase_08 AC 684 ms
76,288 KB
testcase_09 AC 681 ms
76,672 KB
testcase_10 AC 675 ms
76,416 KB
testcase_11 AC 671 ms
76,032 KB
testcase_12 AC 668 ms
76,032 KB
testcase_13 AC 676 ms
76,288 KB
testcase_14 AC 688 ms
76,288 KB
testcase_15 AC 695 ms
76,672 KB
testcase_16 AC 686 ms
76,416 KB
testcase_17 AC 678 ms
75,904 KB
testcase_18 AC 675 ms
76,032 KB
testcase_19 AC 685 ms
75,904 KB
testcase_20 AC 686 ms
75,904 KB
testcase_21 AC 678 ms
76,288 KB
testcase_22 AC 682 ms
76,288 KB
testcase_23 AC 680 ms
76,032 KB
testcase_24 AC 676 ms
75,904 KB
testcase_25 AC 677 ms
76,416 KB
testcase_26 AC 42 ms
52,096 KB
testcase_27 AC 559 ms
76,032 KB
testcase_28 AC 573 ms
76,032 KB
testcase_29 AC 566 ms
76,160 KB
testcase_30 AC 558 ms
76,544 KB
testcase_31 AC 555 ms
76,032 KB
testcase_32 AC 41 ms
51,584 KB
testcase_33 AC 323 ms
76,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
for i in range(N):
    A,B=map(int,input().split())
    L=0;R=10**5
    while R-L>1:
        M=(R+L)//2
        ok=1
        if M*M<A+B:
            ok=0
        tmp=M*M-(A+B)
        if 4*A*B>=tmp*tmp:
            ok=0
        if ok:R=M
        else:L=M
    print(R)
0