結果

問題 No.2420 Simple Problem
ユーザー nikoro256nikoro256
提出日時 2023-08-12 15:28:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 76,504 KB
最終ジャッジ日時 2024-04-30 09:29:33
合計ジャッジ時間 23,873 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,920 KB
testcase_01 AC 329 ms
76,440 KB
testcase_02 AC 64 ms
68,072 KB
testcase_03 AC 167 ms
76,184 KB
testcase_04 AC 582 ms
76,112 KB
testcase_05 AC 392 ms
76,148 KB
testcase_06 AC 724 ms
76,212 KB
testcase_07 AC 735 ms
76,352 KB
testcase_08 AC 714 ms
76,212 KB
testcase_09 AC 713 ms
76,112 KB
testcase_10 AC 716 ms
76,132 KB
testcase_11 AC 720 ms
76,248 KB
testcase_12 AC 697 ms
76,200 KB
testcase_13 AC 705 ms
76,060 KB
testcase_14 AC 738 ms
76,064 KB
testcase_15 AC 726 ms
76,128 KB
testcase_16 AC 728 ms
76,136 KB
testcase_17 AC 707 ms
76,436 KB
testcase_18 AC 703 ms
76,468 KB
testcase_19 AC 717 ms
76,216 KB
testcase_20 AC 723 ms
75,940 KB
testcase_21 AC 717 ms
75,872 KB
testcase_22 AC 711 ms
76,504 KB
testcase_23 AC 718 ms
76,004 KB
testcase_24 AC 713 ms
76,324 KB
testcase_25 AC 714 ms
76,220 KB
testcase_26 WA -
testcase_27 AC 586 ms
76,112 KB
testcase_28 AC 586 ms
76,452 KB
testcase_29 AC 580 ms
76,328 KB
testcase_30 AC 574 ms
76,480 KB
testcase_31 AC 592 ms
76,000 KB
testcase_32 AC 38 ms
53,276 KB
testcase_33 AC 323 ms
76,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
for _ in range(N):
    A,B=map(int,input().split())
    mi=0
    left,right=0,6*10**5
    while right-left>1:
        mid=(right+left)//2
        if A+B<mid*mid:
            right=mid
        else:
            left=mid
    mi=right
    left,right=mi,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