結果

問題 No.2420 Simple Problem
ユーザー dyktr_06dyktr_06
提出日時 2023-06-21 00:38:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 704 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-23 19:07:03
合計ジャッジ時間 25,202 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,712 KB
testcase_01 AC 327 ms
76,288 KB
testcase_02 AC 71 ms
68,480 KB
testcase_03 AC 175 ms
76,544 KB
testcase_04 AC 572 ms
76,160 KB
testcase_05 AC 389 ms
76,160 KB
testcase_06 AC 671 ms
76,160 KB
testcase_07 AC 671 ms
76,416 KB
testcase_08 AC 687 ms
75,904 KB
testcase_09 AC 704 ms
76,288 KB
testcase_10 AC 679 ms
76,032 KB
testcase_11 AC 675 ms
76,416 KB
testcase_12 AC 688 ms
76,160 KB
testcase_13 AC 678 ms
75,904 KB
testcase_14 AC 674 ms
75,904 KB
testcase_15 AC 696 ms
76,416 KB
testcase_16 AC 689 ms
75,904 KB
testcase_17 AC 697 ms
76,288 KB
testcase_18 AC 683 ms
76,160 KB
testcase_19 AC 678 ms
76,032 KB
testcase_20 AC 688 ms
76,160 KB
testcase_21 AC 699 ms
76,416 KB
testcase_22 AC 695 ms
76,416 KB
testcase_23 AC 696 ms
76,160 KB
testcase_24 AC 671 ms
76,032 KB
testcase_25 AC 661 ms
76,416 KB
testcase_26 AC 43 ms
52,608 KB
testcase_27 AC 564 ms
76,032 KB
testcase_28 AC 545 ms
76,288 KB
testcase_29 AC 540 ms
76,160 KB
testcase_30 AC 570 ms
76,032 KB
testcase_31 AC 552 ms
76,032 KB
testcase_32 AC 41 ms
51,840 KB
testcase_33 AC 334 ms
76,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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