結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2023-08-12 16:59:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 750 ms / 2,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 76,672 KB |
| 最終ジャッジ日時 | 2024-11-20 06:52:29 |
| 合計ジャッジ時間 | 23,802 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
def issatisfy(m, a, b) -> bool:
s = m**2 - (a + b)
if s <= 0: return False
return 4*a*b < s**2
# INF = 1 << 60
INF = 10 ** 5
N = int(input())
for _ in range(N):
A, B = map(int, input().split())
lo = 1
hi = INF
ans = INF
while lo <= hi:
m = (lo + hi) // 2
if issatisfy(m, A, B):
ans = min(ans, m)
hi = m - 1
else:
lo = m + 1
print(ans)
norioc