結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2023-08-18 20:44:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 426 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 81,964 KB |
| 実行使用メモリ | 153,344 KB |
| 最終ジャッジ日時 | 2024-11-28 04:26:41 |
| 合計ジャッジ時間 | 82,577 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 TLE * 24 |
ソースコード
# 10**9全探索はできないがsqrt(10**6)なら全探索可能
# A < Bとする
from math import floor, ceil
T = int(input())
for t in range(T):
A, B = map(int, input().split())
if A > B:
A, B = B, A
mn = floor(A**0.5)*2
mx = ceil(B**0.5)*2
#print('mn', mn, 'mx', mx)
for x in range(mn, mx+10):
if (x**2-A-B) > 0 and 4*A*B < (x**2-A-B)**2:
print(x)
break
FromBooska