結果

問題 No.2420 Simple Problem
ユーザー Nafmo2
提出日時 2023-07-15 15:33:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,896 KB
実行使用メモリ 76,192 KB
最終ジャッジ日時 2024-09-17 00:30:01
合計ジャッジ時間 17,962 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

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