結果

問題 No.2420 Simple Problem
ユーザー sepa38sepa38
提出日時 2023-07-17 12:20:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,700 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 77,092 KB
最終ジャッジ日時 2023-11-04 06:38:23
合計ジャッジ時間 54,016 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,652 KB
testcase_01 AC 735 ms
76,412 KB
testcase_02 AC 73 ms
76,092 KB
testcase_03 AC 314 ms
76,128 KB
testcase_04 AC 1,357 ms
76,856 KB
testcase_05 AC 895 ms
76,524 KB
testcase_06 AC 1,692 ms
77,084 KB
testcase_07 AC 1,683 ms
77,072 KB
testcase_08 AC 1,686 ms
77,072 KB
testcase_09 AC 1,681 ms
77,068 KB
testcase_10 AC 1,675 ms
77,072 KB
testcase_11 AC 1,681 ms
77,080 KB
testcase_12 AC 1,683 ms
77,080 KB
testcase_13 AC 1,700 ms
77,080 KB
testcase_14 AC 1,682 ms
77,072 KB
testcase_15 AC 1,690 ms
77,072 KB
testcase_16 AC 1,689 ms
77,088 KB
testcase_17 AC 1,685 ms
77,080 KB
testcase_18 AC 1,681 ms
77,084 KB
testcase_19 AC 1,690 ms
77,080 KB
testcase_20 AC 1,692 ms
77,084 KB
testcase_21 AC 1,695 ms
77,080 KB
testcase_22 AC 1,679 ms
77,084 KB
testcase_23 AC 1,680 ms
77,092 KB
testcase_24 AC 1,687 ms
77,084 KB
testcase_25 AC 1,684 ms
77,080 KB
testcase_26 AC 38 ms
53,660 KB
testcase_27 AC 1,368 ms
76,868 KB
testcase_28 AC 1,370 ms
76,872 KB
testcase_29 AC 1,382 ms
76,872 KB
testcase_30 AC 1,380 ms
76,876 KB
testcase_31 AC 1,381 ms
76,868 KB
testcase_32 AC 36 ms
53,660 KB
testcase_33 AC 718 ms
76,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  a, b = map(int, input().split())
  l, r = -1, 1 << 20
  while r - l > 1:
    x = (l + r) // 2
    if 0 < (x ** 2 - (a + b)) ** 2 - 4 * a * b and x ** 2 - (a + b) > 0:
      r = x
    else:
      l = x
  print(r)
0