結果
| 問題 | No.2420 Simple Problem |
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2023-08-18 20:44:59 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 1,120 ms |
| コンパイル使用メモリ | 81,788 KB |
| 実行使用メモリ | 84,232 KB |
| 最終ジャッジ日時 | 2026-10-01 06:19:26 |
| 合計ジャッジ時間 | 18,242 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 TLE * 4 -- * 27 |
ソースコード
# 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