結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2023-08-12 16:54:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 444 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,296 KB |
| 実行使用メモリ | 156,440 KB |
| 最終ジャッジ日時 | 2024-11-20 06:45:41 |
| 合計ジャッジ時間 | 92,122 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 TLE * 29 |
ソースコード
def issatisfy(m, a, b) -> bool:
s = m**2 - (a + b)
if s <= 0: return False
x = 4 * a * b
y = s ** 2
return x < y
INF = 1 << 60
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